Added show_table tool and fix some small bugs