Big commit after holidays.

This fix and close issue #8.