fixed connection(s) typo and don't dereference NULL