Agreement on final stumbling blocks reached