Added datatype checking when replacing params.