Identation, whitespace and other cosmetics fixes in templates