Some cleanup of the diff/incr code.