Better handling of refused connections. Still not perfect - see #7