Add logging to make debugging less impossible - closes #1