Don't produce overlapping output or prompts.

See #96 and #101