several minor fixes