Updated selection size calculation code for writeblocks.