Specifically, rebinding the command handler doesn't take effect until after all input lines have been handled. This means handle_command_prereg doesn't get new values when it ought to.