Improved whitespace handling