Fixed an error caused by a signed/unsigned conversion error.