Timeout fixes.

Fixes issues with bot dealing with timeout errors and reconnecting.