Changed to get the deserialisation length from the vector length.

This removes the bug where variable length types were incorrectly deserialised. Thanks to @nilsbore for reporting the bug.