Casting to longs to remove warnings