Bug and typo fixes.