Fixed more opt. bugs