Fix optimized code