Fixed some bugs. CheckStyle runs without errors