Fix optimizations