Fix pathname escaping problem