Checks and test for invalid characters in path