For the INTERNAL problem with the mega2560 I found this: http://arduino.cc/en/Reference/AnalogReference
INTERNAL: an built-in reference, equal to 1.1 volts on the ATmega168 or ATmega328 and 2.56 volts on the ATmega8 (not available on the Arduino Mega)
INTERNAL1V1: a built-in 1.1V reference (Arduino Mega only)
INTERNAL2V56: a built-in 2.56V reference (Arduino Mega only)
So just replace "INTERNAL" with "INTERNAL1V1" and it should work.