Fix syntax errors, remove trailing whitespaces