Fixes compiler warning and a mis-use in a block