Optimization fixes.