Initialize optimization properly.