Reworked envelope check to work in the 2.68 API