Correct errors in path handling