Add timeout test
Fix some edge cases