Fixed #613. Proves the issue described in #613 and added a kind of fix for it.

That added method shouldn't be used in other internal code, but for the scenario mentioned in #613 it should be one of the most elegant ways.