Clean up JS to fix errors.
Merge pull request #93 from smeranda/2013

Clean up JS to fix errors.