many minor fixes