various fixes to queueing system