Added missing 'end' to avoid crashes
Merge branch 'hotfix/1.0.1'