incorportate fixes from the assembly-saver branch