More fixes to path manipulation functions