Fix removeCommonPath throwing an exception when path does not exist.