Clean up batch tools command line script, bug fix for metadata update