Add checks and fix issues
Merge pull request #4 from Papa-Smurf151/master

Add checks and fix issues