Corrected bugs in the program.

Signed-off-by: aywu <aywu477@gmail.com>