Fixed for hangs

See https://lowpowerlab.com/forum/index.php/topic,736.30.html.