Fix syntax errors, hoover whitespace, remove duplicates