integer type compatibility fixes