Path expansion logic, as per #64