fix bug null/undefined bug

This will also fix the build for node 0.8.x