Make expression writer work with multiple expression hierarchies