Fix bug in comparing negative lengths.