Improved error messages - fixes #1