(Hopefully) fix non-unique orientation bug

Found and fixed an issue with all-orientations not actually producing
all orientations.  test.check test for uniqueness now passes.

I haven't proved that things are actually unique and they might still
not be but at least it doesn't come up as soon now.

Also some line length fixes.