changes required by lensification of envelope, trace

mostly additional type constraints