Fixed a couple of bugs introduced when adding handling for timeouts