Fixing test case (and invalid JS)