small internal fixes