Reconnect errors

@nkzawa and @jjmaceda Can you give this branch a shot?