Fix formatting issues

* Remove trailing whitespaces
* Rename method names of event listeners
* Check for negative instead of positive