Fixed a bug in connecting start and end sites with pseudo sites