Fix for optimization