EZP-23364: additional fixes and tests