Add system logging; minor fixes.
Merge changes.