Fixed issue #2616
Minor: improved error messages