Cleaning up a few bits with help from JSLint.