Fixed bug when using switch parameters with actions and the switch param is not at the end