Fixed flagging logic and press/unpress logic