Fix incorrect non-integer usage in function calls.

This fixes all issues uncovered by https://github.com/numpy/numpy/pull/3243