Added some minor fixes and improved comments