Fixed some connection crashes