fix for incorrect sorting with multiple blended entities (issue #605)