bug 894: A few cleanups and bug fixes.