fix typo
support negative lengths