EEPROM_writeAnything not working quite right

I’m trying to get a test program to write and read three values.

It compiles ok.
I’m getting strange numbers back.
Instead of 1500, 1600 and 1700, I am seeing 16604, -23488 and 1700

What am I missing??

Here’s the code:

#include <EEPROM.h>
#include <WProgram.h>
#include "EEPROMAnything.h"

int a = 1500;
int b = 1600;
int c = 1700;
int val;


void setup()
{
     Serial.begin(9600);
     Serial.println("Start");
     
     // write a 0 to 3 addresses of the EEPROM
    EEPROM_writeAnything(0, 0);
    EEPROM_readAnything(0, val);
     Serial.println(val);
    EEPROM_writeAnything(1, 0);
    EEPROM_readAnything(1, val);
     Serial.println(val);
    EEPROM_writeAnything(2, 0);
    EEPROM_readAnything(2, val);
     Serial.println(val);
    
    // write values to 3 addresses     
      EEPROM_writeAnything(0, a);  
      
      EEPROM_writeAnything(1, b);
      
      EEPROM_writeAnything(2, c);


  EEPROM_readAnything(0, val);
  Serial.println(val);     // getting 16604
  EEPROM_readAnything(1, val);
  Serial.println(val);    // getting -23488
  EEPROM_readAnything(2, val);
  Serial.println(val);    // getting 1700

Serial.println("Done");

}

void loop()
{
      
}

Here is the code for EEPROMAnything.h

#include <EEPROM.h>
#include <WProgram.h>  // for type definitions

template <class T> int EEPROM_writeAnything(int ee, const T& value)
{
    const byte* p = (const byte*)(const void*)&value;
    unsigned int i;
    for (i = 0; i < sizeof(value); i++)
          EEPROM.write(ee++, *p++);
    return i;
}

template <class T> int EEPROM_readAnything(int ee, T& value)
{
    byte* p = (byte*)(void*)&value;
    unsigned int i;
    for (i = 0; i < sizeof(value); i++)
          *p++ = EEPROM.read(ee++);
    return i;
}

moderator: added code tags

An int has 2 bytes and you are using addresses 0 1 and 2

so could it be that the values overlap ?

try using address 0 2 4