Fix some "implicit conversion loses integer precision" warnings.