Fix bug in long dialog prompt handling