Bugfix. Closes #8.

Reported by PeterC-DLS (thanks!)