Correct type for length variable to avoid compiler warnings.