Upgraded for node 0.10.0. Added better error support.