CPU bug fix

Fixed bug with modulo arithmetic in CPU class