When the rights of a lessee or lienor are shown by cross-petition filed before judgment, such rights and liens shall be regarded by the court of common pleas, and no inequality shall be allowed or injustice done to such lessee or lienor.