Removed trailing whitespace and fixed errors