Fix small bugs.
Segmentation fault occurs due to potential bug. This bug is detected when gcc is Ubuntu 6.5.0-2ubuntu1~16.04 (on cube3), thanks to xys.
Segmentation fault occurs due to potential bug. This bug is detected when gcc is Ubuntu 6.5.0-2ubuntu1~16.04 (on cube3), thanks to xys.