Fix to http://jira.diamond.ac.uk/browse/SCI-1192
http://jira.diamond.ac.uk/browse/SCI-1191