use nan for 0.8->0.11+ compatibility

fixes #42