Bug fix agenda ranges
Merge branch 'agendasfix' into master