fix block sorting during printing

Caught by valgrind.