Cleaned up based on jsHint.