Fixed bug that crashed when selecting some formulas.

Fixed issue #73.