Add guard around set size