Respond to authentication challenge, fixes timeout on OS X 10.10. Thanks to @eelco.
Resolved a few warnings.