Fix register assignment error