Fixed jslint errors and faulty test case.