fixed warning introduced in recent commit
improved error message