Some more bug fixes for optimization