Fix how free slots are calculated.