Fix params checking.
Use foreach but not each to do not leave iterator.
Merge pull request #1 from wtertius/fix_params_checking

Fix params checking.