Fixed bugs with the way parameters are added