Fix for do: optimizations