numerous minor fixes