Add logging to make problem diagnosis easier

Closes #10