Small fix for shorten function.