Fix stupid bug in call to optimize()