Fixed bit mapping and wrong shifting if modulo expr returned 0