Reorder cases, correct indentation, remove unneeded variable and sprintf. This was SVN commit r17638.