Fixed setParams method and added test