Fix some registerization bugs uncovered by the testsuite.