Fix test
Add some checks for bad parameters