fix problems when specifying encoding, and stepping through large expressions