Fix NPE on delete.
Merge pull request #240 from eric-wu/js

One more attempt to fix failed tests