fixes for node 0.8, 0.6