Fix #4
Merge pull request #7 from mWater/null-crash-fix

Null crash fix
Merge pull request #10 from mWater/issue4

Fix #4
Fix #11
Merge branch 'issue11' into dev