Fix for when length is zero