(And clean up tabs and whitespace while rummaging around in there) Closes issue 5084. --HG-- branch : trunk