Bugfixes and small change for Ceres 1.7