error handling improvements in BAM code paths
remove unnecessary import
improve wording of dataset_id not set warning