Pick a more suitable type for nLength

Change-Id: I6e38b82f08884c4e187e5b3ca2c95a0d4ca8d541