Fix segfault, #768
Merge pull request #769 from sjinks/issue-768

Fix segfault, #768