Fix bug with reading vector