Fix nodejs 0.6 and 0.8 compile errors