Various minor bug-fixes.