Bugfix identified by Julian Cain.
Merge pull request #2 from Fraser999/master

Bugfix identified by Julian Cain.