Added explicit casting to vectors.