numerous minor bug fixes.