Spotted during development of wip/carlosg/input-thread, and separated to make that branch a bit lighter.