Fixes around timeout and error handling