[cleanup] Applied codestyle, removed commented out code
[misc] Fixed a possible NPE