Improvements to the prompt handling.