Made sidebar handle more selection edge cases