A geometry bugfix, and some desultory unit tests