Fixes for more efficient assertion sorting