Fix bugs in TimeoutQueue. Re-enable previously failing test.