Tidied up the JS errors