Cleaned up code to satisfy JSLint.