add connection timeout, slight fixes

Signed-off-by: Steve Markgraf <steve@steve-m.de>