Added code to trap exceptions during execution and log molecules that are removed because of this.