Revisions to JS to comply with jslinting.