Use correct type for length