Fixed JS error and the test file