Improve ST_Envelope

@mlecoeuvre Please see these corrections.