Redirect check and timeout fix

Possible for endless redirects, so added check. Also added timeout
option and custom error message on timeout.