Fixed some bugs in the hardware registers