Cleaned up code, made JSLint happy.