Hacky fix for handling selections after deletion.