minor changes to support optimizations in colreorder and a couple fixes