bugfix: apply Hasegawa-san's patches
a workaround