Compatible with node v0.6 and v0.8.