Log exceptions

Fixes #22