Fixes a selection-marking bug