Fixes #5558: allow to use $ { } in variables and correct class condition...

... and reporting
What do you mean it fails? What fails, and how?