Fix to http://jira.diamond.ac.uk/browse/SCI-1959 and http://jira.diamond.ac.uk/browse/SCI-1958