Browserify fix

Fixes #214 

Also resolved #597