Added getEnvelope and some additional tests