Deleted old optimizer. Fixed some runtime bugs.