Fix some deprecation warnings.

For node 0.8.x and 0.6.x.