Fix duplicate parameters in some cases