Fix appearance of agenda items with related sid, also some other small fixes and template fixes