Fix Envelope for vectors and add tests (and split old test file into three)