Clone modes object, rather than passing by reference.