Made the timeout exception handling slightly more efficient and tested
it a bit. A buffer of 500ms seems good enough now.