Added custom serialization for valarray and vector (needed to fix include conflicts)