Fixed a bug and improved error message for user.
Improved error reporting of the new features.