Add some casts needed to fix build errors I was getting in the test suite