Fix bug in new timeout system
Fix bugs in timeout