Fixed assertion error. Off by 1