Set client timeout to 5 seconds

...And some small optimizations in the error reporting.