Made `hasFile` of the path services more robust