Some bug fixes.
More minor changes.