fix TypeError on node v0.8.x

Closes #7.