Added reachability support. Fixed a few bugs