Added sanitize_filepath() to make legal UNIX filepaths