i2c / twi: issues with magnetic field?

I'm using an Arduino to 'i2c' (that is not a verb but it should be I think ;)) with another avr IC (2313). So far so good. However if I put the two in my final application (A LEGO train), it doesn't work anymore.
The signals don't seem to be received by the slave device.

Length of the cable is about 60 cm. I use two 1k5 pull-ups at the arduino side. I was wandering, could the magnets between the cars have something to do with this?!

The issue was a software problem in fact, so indeed the magnets aren't a problem.

But I still have another problem. If I send too many messages the arduino hangs. I know a way around it (just skipping most messages), but how could the hanging of the arduino be avoided? As soon as I disconnect the twi cable it goes further again.

current twi send code is:

void sendByteTWI(byte data) {
  delay(250);
  Wire.beginTransmission(1);
  Wire.send(data);
  Wire.endTransmission(); 
  delay(250);
}

//and after an update:
void sendByteTWI(byte data) {
  if (lasttwicmd != data) {
    delay(150);
    Wire.beginTransmission(1);
    Wire.send(data);
    Wire.endTransmission(); 
    delay(150);
    lasttwicmd = data;
  }
}

Since I only need to toggle LEDs I never need to send the same command twice, so I ignore the same commands.