Re #1017: key stuck removed for AVR platforms, fixed bug in wait