Fixing sort and constructor name generation.

PP is still to come.