improved error messages to resolve issue #176