Fix raising of time out error and associated test.