Fixes recursive optimizations