Fix #1148: sort values on search failing round trip serialization

Closes #1148