Softserial not working with A7 as input

Here is the problem. The pinMode function starts out:

void pinMode(uint8_t pin, uint8_t mode)
{
	uint8_t bit = digitalPinToBitMask(pin);
	uint8_t port = digitalPinToPort(pin);
	volatile uint8_t *reg, *out;

	if (port == NOT_A_PIN) return;

Then it modifies I/O registers depending on the value of port and bit. When you pass A7 to the function, it gets the value of port and bit by looking up in a table indexed by the pin. A7 has the value 21. However the tables have only 20 elements. So it reads whatever data is in memory beyond the end of the table. If the value is not NOT_A_PIN (which is defined as 0), the function merrily proceeds to mess up some registers, which just might be configuring pins 11 and 12.