Eeprom behaves unpretictable

The probability that you are doing something wrong is immense.
You only show a small part of some gruesome code that does not compile.
Without all the missing defines and definitions you are expecting hint from someone.

If you are interested in solving the issue, provide a compiling example of the errors.
And a decent description how the actual behavior differs from your expectations.