Fixed typos and missing semicolons etc.