fix all current tests except square_distance in agrad-rev