Changed NanThrowErrNo to use casting instead of toObject.