Corrected expectedLength calculation in compileSet()