Fixed up the path parsing functions