[Thanks to Jean-Jacques Dauchot]
Line 641 of the PORT_Pin_Read() in the file port23xx.c should read:
if (IO1PIN & Pin){...}
instead of:
if (IO0PIN & Pin){...}
— Anjali.