Bug: second arg to sum-of-squares depends on the result of first