Add logging, minor fixes

Fixes #5