At an often fractious conference that ended Monday , diplomats worked into the night Sunday trying to agree on how to define terrorism .