fix tests
fix path-creating bug
fix sorting bug