Fixed a typo in the result length check