Improved test for unset, improved message when exception occured