bugfix for 10472

http://d.puremagic.com/issues/show_bug.cgi?id=10472

and some whitespace to follow code guidelines