Fixed bug with wrong selection counter introduced by new event handling.