Various minor adjustments and bug fixes.