Add -p option to dump and fix a bug in model.