Fixed setParameters function