Remove `console.log` cruft
Fix type check

Fixes #31.
Fix incorrect callback invocation

Node.js convention is `callback(error, result)`.