Fix register errors and redirection