Mediators have resolved disputes over the Gaza ceasefire deal, paving the way for its implementation on Sunday.