Fixed exception coming from Jasmine (local modification, and not going to contribute back because Jasmine is getting a rewrite anyway).