Fixed several syntax issues after running through JSHint