Fixes to test_generates_algebra

Which I wouldn't have noticed without a truck load of tests and
examples!