Fix various registry issues