Fix #16. Make sure error objects are always passed to callback.

Also tidies up some misc linty/styley things.