Minor changes, mostly bug fixes.