Fix relative paths function.