Added preliminar support for detecting already merged tables.
Some more tests for combinations of conditions, that needed that support.