More work, cleaning up, fixing more unit tests for issue #207.