Fix whitespace issues and remove stray closing tags