Remove PathManager and fix path validating bug.