Cleaning up function registers and setting up CR.