Correctly order wrapped statements in base relation