Some fairly simple logic would make this a bit more usable...
for example when scanning the matrix, if 1 and 3 are on, check and see if a or c was pressed previously... if not they probably just pressed d. Otherwise you can deduce that the other 2 keys were pressed individually. Also, depending on what the keys are meant to do, you could contrive the wiring such that it is unlikely that you would have ghosting conditions. I'm kind of tired so I'm sure I'm not explaining it very well, but hopefully you get the point.