Fix testing in _get_summary.
Add a whole bunch of unit tests.