Trim trailing whitespace, add missing semicolon