Various attempts to clean up DCP comparison code.