The court in its discretion may refer the whole or any part of the matter back to the same or other referees, to be selected in the same manner, or as the parties agree, giving them directions as to the report required of them. When the court is sufficiently advised in the case, it shall make its decision, and may direct the homestead to be marked off anew, or a new plat and description to be made and recorded, and take such other steps as shall be lawful and expedient in attaining the purpose of this chapter. It shall also award costs in accordance with the practice in other cases, as nearly as may be.