Fix compiler warnings

This fixes a few compiler warnings of number casting