Fix length check