Ported to NAN 1.1.0