You need to determine if the problem is hardware or software. Print the PINs...
Serial.println( PINA, BIN );
Serial.println( PINB, BIN );
...
...and compare to the digitalReads. If the values match, the problem is hardware. Otherwise, the problem is software.