Fixed a bug for the bounds of the subseg routine and off by one errors in the same area. Initial tests with two files were successfull.