Bug minor fixes in the distiller