Fixed formatting issues and created an additional test for the case where the same path object is supplied