Fixes select all/none behaviour.