Minor bug fixes to the program to ensure the mapping works.

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