Code cleanup: Replace old hashes and remove trailing spaces

I'm use gem 'pre-commit' to keep my code clean. Sometimes, after editing the code, I get a diff line, which I have not edited, but they contain trailing spaces, empty EOF lines or old style hashes. This PR contains the code without them.