Commit for problems found when investigating case SVY-7198.

Actually this commit fixes problems or does some enhancements related to
cases SVY-7158 and SVY-7182. Case SVY-7198 actually was invalid.