apply daniel's fix for vector bug.