Fixed Vector out of bounds issue