Fixed some compiler warning about signed/unsigned conversions.