Improved error messages. Closes #56.