Fix a bug with type checking of path