ensure_length edge cases