Fixed topological sorting bug in CH serializer.