fixing whitespace issues and string escaping.