To address bugs #77 and #661, add some code that should avoid triggering infinite loops between keyboard and chair.