Fix segmentation fault
Merge pull request #21 from massix/master

Fix segmentation fault