Correct spacing between roman numbers in toc for parts

In my document, the roman numbers to the left of the part names are too close to the text.

I use this snippet the following codesnippet to correct the issue, but it gives me an undefined control sequence.

\ifthenelse{\boolean{@parts}} {\renewcommand{\thepart}{\hspace{-0.5em}\hbox to 1em{\hfill\roman{part}}}}{}


The error:

Undefined control sequence ...0.5em}\hbox to 1em{\hfill\roman{part}}}}{}
Extra \fi ...0.5em}\hbox to 1em{\hfill\roman{part}}}}{}


Another thing is that the roman numbers are not in lowercase. Is it possible to make them uppercase instead?

Image of the problem:

Thanks.

-
Actually, this snippet does not work because it also changes the spacing of the roman numbers on the pages separating each section. –  thilemann Dec 19 '12 at 10:33
Can you provide an image with the wrong spacing? I guess you mean the entry in the ToC, but I'm not sure. –  mafp Dec 19 '12 at 10:54
I have added two images; one showing how the ToC looks and another showing how the pages are separated. When using the code snippet, the ToC looks ok but then the spacing between "Part" and the numbers on separating page is corrupted. –  thilemann Dec 19 '12 at 11:09
@thilemann It's essential to know what class you're using, along with any package that might act on the table of contents. –  egreg Dec 19 '12 at 11:53
Sorry for the missing information. I am using the memoir document class and not any specific packages related to ToC. But an answer to the problem has been accepted. –  thilemann Dec 19 '12 at 13:05

I don't know how you made the ToC to crash the numbers into the titles (a complete MWE would be great), but controlling the appearance of the ToC is best left to package tocloft. There it is recommended to use
\setlength{\cftpartnumwidth}{3cm}