Fix for state management issues with registration flow.