Fixes some errors accessing vectors