Fixed some bugs relating to keyboards with more than 16 columns. Also added the ability to mask off keyboard matrix bits.