Cleaning and tidying

- Remove trailing spaces
- Fix some formatting