a few fixes to enable running in strict mode

I got some errors using this library with node --harmony --use-strict. This seemed to fix them.