Solving #TRUNK-3445

I've handled it without changing the whole classes around there. But it is a bit messy in these classes and unit-tests, don't you think?