Fixed Canonicalise directory method

SplitString didn’t preserve the order of the path.