Fix bug #618
Merge pull request #619 from spankyj/issue618

Fixes #618