generation of expression; misc. fixes