Bug fixes and sundry.