Fix for #215 and some other related improvements

This library is using PSR-1 and PSR-1 as it's coding standard, please install it to your IDE and fix the code formating.