I cannot replicate the problem, I think another mod you have installed may be causing an issue.
But, I updated this mod anyway to check for valid selection size before updating an entity to hopefully fix this issue.
If this does not fix the issue, tell me the Factorio version and please list your mods so I can check.