Fix infinite loop in rMkpath