Fix config.optimize. Closes gh-492.