Fixed wrong ordering of agenda items after order change

Fixed #875
Merge pull request #878 from ostcar/change_agenda_items

Fixed wrong ordering of agenda items after order change