Add remote description length check, add tests, and fix dispatch.