Improve error handling #21