Add --show-schema, fix a couple of bugs