Fixed to pass test cases correctly.

Signed-off-by: Tsuyoshi Ozawa <ozawa.tsuyoshi@gmail.com>