avoid some compilation warnings, and assert on expected integers being integers; fixes #3089