fix and simplify modulo shift value of mode_P