(2) This section does not affect the power of a testator in the disposition of real property by a last will and testament, nor to prevent a trust from arising or being extinguished by implication or operation of law, nor to affect the power of a court to compel the specific performance of an agreement in relation to such property.