Remove suffix from correct part of path