Fix hard coded length in get segment method.