Revert "Use for x in dict instead of for x in dict.keys()",
since the Params objects don't support the "for in dict" syntax.

This reverts commit 0871fd4ced43649e2147414189121485e1d4b5cc.