Add argument checks
Merge pull request #1 from ermau/arg-checks

Add argument checks