Correct JS Errors
Adding tests