Add further transition tests
Refactor timeout handling