Fixes for optimizations.