Improve verify_path error handling.