Bugfix: sleeping threads never quit

Sometimes these threads would be sleeping forever. Fixed now.