Better validation of int params, added tests for those
Remove dead code