Added a couple of checks and default timeouts.