Adapted to the new nalgebra api.