Fixed some minor coding style issues

Also fixed and added a few more comments