Fixed undefined offset when path only have one part