Fixing JSHint issues and improving comments.