WIP Fix 251: Improve error handling

Fix #251
Reminder to self: FIXME