Added reachability check
Fixed some format errors