Fixed a serious bug in squaring test code.