Add free_matrix where needed for spheres and tori.