Better error messages, fixed #5