Tweaked how parameters are cleared to address an issue with an empty
array still being passed and getting an error thrown.