Fix for exceptions from enchant.js