Some internal fixes.