Applied patch from skomatsu.comutt.