Whitespace and character encoding fixes