The scan is performed with to lines for each key, and then the timedifference between the exitation gives the velocity.
I had a some keys on my D50 that didn't respond and some that always had velocity 100, so i removed the dirt under the rubberpads. If that doesn't fix all the keys then you could tyr to replace the rubberpads they are not that expensive. I've had this problem many times with the D50 so it wouldn't be a surprice if it also happens for a D5