improved error messages when reading invalid arrays, vectors, strings and bit-vectors