Fixed a nasty bug, where some subformulas were being deleted.