Problem with EEPROM

I don't understand what's happen here. I'm using 1.6.7 of the IDE and (as far as I know), I'm up to date with all the libraries. Here's what I've done.
I have a structure that contains the run time preferences for my little application. In setup(), I initialized the values and called EEPROM.put(addr, params); This was just to initialize EEPROM. Then I commented out that code, and added EEPROM.get(addr, params) to read the saved values. So far so good. Works like a charm.
Now, during the operation of the program, the user makes some changes and when finished, I "put" that into EEPROM with EEPROM.put(addr, params).
Next time I reset (hard or soft), those user changes were not actually saved. I still get the values from the initial put().

Is EEPROM.put() supposed to work anywhere except in setup()? Doesn't seem to for me.
Some excerpts from my code:

...
struct _params {
  int min;
  int max;
   ...
} params;

void setup() {
  EEPROM.get(0, params)
}

void update_params()
{ 
  Serial.println("updating preferences...");
  params_dirty = 0;
  EEPROM.put(0, params);
}

void loop()
{
...
  if (params_dirty != 0) update_params();
...
}

cleamon:
Some excerpts from my code:

Unless you just want some excerpts from the answer, it’s a good idea to post all of the code, not just a snippet.
No one can compile/verify a snippet.
snippets-r-us

OldSteve:
Unless you just want some excerpts from the answer, it's a good idea to post all of the code, not just a snippet.
No one can compile/verify a snippet.
snippets-r-us

Well, thanks anyway. I did figure out the issue. I had the EEPROM.put() inside a switch statement, which did execute (as evidenced by a Serial.println()) , but the eprom was not written to. I moved that code to a point outside the switch statement and it's now working. I'm guessing the compile optimized that out for some reason.

cleamon:
Well, thanks anyway. I did figure out the issue. I had the EEPROM.put() inside a switch statement, which did execute (as evidenced by a Serial.println()) , but the eprom was not written to. I moved that code to a point outside the switch statement and it's now working. I'm guessing the compile optimized that out for some reason.

Glad you got it sorted out.