Cleaning the code, fixing codestyle, PSR-2 compatibility etc.
Fixing a typo in sample configuration.