gcc compability issue resolved with std::is_same
- own is_same template fkt to prevent problems with old gcc versions.
- Fixed rare bugs for single cut with startY