make sure path components are strings