Fix #1431 - sort with null nodes.