Fixed bug - invalid optimization term.  (Don't know if it's fixed correctly...)