Upgraded for compatibility with node v0.10.x