Fixed a crash issue.
Merge pull request #58 from jcgsxr/fix/crashes

Fixed a crash issue.