Add test case for iterator data argument
Move the type check up to where other checks are performed