compatibility fixes for node 0.6 & 0.8