GDA-5966 fix off-by-one error
Merge branch 'gda-8.40' of ssh://dasc-git.diamond.ac.uk/gda/gda-epics into gda-8.40