In these cases the partition shall be made according to the respective rights of the parties, setting apart to such as desire it their shares in severalty, and leaving the shares of others, if desired, in common; and if there are minors, the court may, in its discretion, leave their shares in common, or set them apart to each in severalty, as may appear to be just, upon the proof introduced.