Some minor bug fixes.