diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6ebc9f63d335adbb530214eb629980c7d052c990..d81f29fe862c7d1caef4a2bd383e6d07db2cb1c1 100755
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -58,6 +58,7 @@ build-from-test-image:
   script:
     - pip3 install --upgrade pip
     - pip3 install -r requirements-dev.txt
+    - pip install git+https://github.com/chasemc/ncbi-genome-download@4c5c24e27aa8123c7995890046b17b815da3571b 
     - py.test test/test_install/test_make_all-installed.py -xv
 
 
@@ -70,6 +71,7 @@ unit-test-ubuntu:
   before_script:
     - pip3 install --upgrade pip
     - pip3 install -r requirements-dev.txt
+    - pip install git+https://github.com/chasemc/ncbi-genome-download@4c5c24e27aa8123c7995890046b17b815da3571b 
     - ./make
   script:
     - pwd
@@ -102,6 +104,7 @@ func-test-ubuntu:
   before_script:
     - pip3 install --upgrade pip
     - pip3 install -r requirements-dev.txt
+    - pip install git+https://github.com/chasemc/ncbi-genome-download@4c5c24e27aa8123c7995890046b17b815da3571b 
     - ./make
   script:
     - pwd
diff --git a/PanACoTA/__init__.py b/PanACoTA/__init__.py
index 811c9d39436e96ae1d6662e531c65a15a0e5f775..3b19d372b87f08bfd93d520ed1519cdf694c80e4 100755
--- a/PanACoTA/__init__.py
+++ b/PanACoTA/__init__.py
@@ -1,5 +1,5 @@
 """PanACoTA"""
 
-__version__ = "1.4.1-dev"
+__version__ = "1.4.1-dev2"
 
 
diff --git a/PanACoTA/align_module/get_seqs.py b/PanACoTA/align_module/get_seqs.py
index d6d347daba06b74d1484408c7caf10bcf1c9e8e2..a8b61df01e533b9684b9a508b6602216d3a1273e 100755
--- a/PanACoTA/align_module/get_seqs.py
+++ b/PanACoTA/align_module/get_seqs.py
@@ -265,10 +265,11 @@ def extract_sequences(to_extract, fasf, files_todo=None, outf=None):
             previous_fp = None
 
             # Extract sequence name
-            last_char = line.find(' ')
-            if last_char == -1:
-                last_char = len(line)
-            seq = line[1:last_char].strip()
+            # last_char = line.find(' ')
+            # if last_char == -1:
+            #     last_char = len(line)
+            # seq = line[1:last_char].strip()
+            seq = line.strip().split()[0][1:]
 
             # Seq is part of sequences to extract
             if seq in to_extract:
diff --git a/PanACoTA/annotate_module/annotation_functions.py b/PanACoTA/annotate_module/annotation_functions.py
index 81846f0f56808c93c45de1dc27c94dbd651abb22..df61768f63e5df437067a4b64f870e7c973764f1 100755
--- a/PanACoTA/annotate_module/annotation_functions.py
+++ b/PanACoTA/annotate_module/annotation_functions.py
@@ -246,7 +246,7 @@ def prodigal_train(gpath, annot_folder):
                         logger=logger)
     prodigalf.close()
     prodigalferr.close()
-    if ret.returncode == 0:
+    if ret != 1 and ret.returncode == 0:
         logger.log(utils.detail_lvl(), f"End training on {gpath}")
         return gpath_train
     else:
diff --git a/containers/Dockerfile b/containers/Dockerfile
index ffa657cfcef85dface6937728b8d5173c63f2070..df7d9e28ae47e7a2f4de2bbe2c6e6b3fa80f110f 100644
--- a/containers/Dockerfile
+++ b/containers/Dockerfile
@@ -1,10 +1,29 @@
-from ubuntu:20.04
+from ubuntu:22.04
+
+# setting these ARGs as global variables, so they persist across all build layers (but not in final production image)
+ARG PROKKA_VER="1.14.6"
+ARG BEDTOOLS_VER="2.29.0"
+ARG BARRNAP_VER="0.9"
+ARG BLAST_VER="2.10.1"
+ARG MASH_VER="v2.2"
+ARG PRODIGAL_VER="2.6.3"
+ARG MAFFT_VER="7.313"
+ARG FASTME_VER="2.1.6.1"
+
+# re-instantiating for the app build layer
+ARG PROKKA_VER
+ARG BEDTOOLS_VER
+ARG BARRNAP_VER
+ARG BLAST_VER
+ARG MASH_VER
+ARG PRODIGAL_VER
+ARG MAFFT_VER
+ARG FASTME_VER
 
 # Update apt-get packages
 RUN apt-get update &&\
     apt-get -y upgrade
 
-
 # Install packages needed and update pip
 RUN apt-get install -y \
         wget \
@@ -15,69 +34,79 @@ RUN apt-get install -y \
 RUN pip3 install --upgrade pip
 RUN mkdir /install_dir
 
-
 # Update makeblastdb and blastp for prokka
 WORKDIR /install_dir
-RUN wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.10.1/ncbi-blast-2.10.1+-x64-linux.tar.gz &&\
-    tar zxvpf ncbi-blast-2.10.1+-x64-linux.tar.gz &&\
-    cp /install_dir/ncbi-blast-2.10.1+/bin/makeblastdb /usr/local/bin/ &&\
-    cp /install_dir/ncbi-blast-2.10.1+/bin/blastp /usr/local/bin/ &&\
-    rm ncbi-blast-2.10.1+-x64-linux.tar.gz
-
+RUN wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${BLAST_VER}/ncbi-blast-${BLAST_VER}+-x64-linux.tar.gz &&\
+    tar zxvpf ncbi-blast-${BLAST_VER}+-x64-linux.tar.gz &&\
+    cp /install_dir/ncbi-blast-${BLAST_VER}+/bin/makeblastdb /usr/local/bin/ &&\
+    cp /install_dir/ncbi-blast-${BLAST_VER}+/bin/blastp /usr/local/bin/ &&\
+    rm ncbi-blast-${BLAST_VER}+-x64-linux.tar.gz
 
 # Install mash
 WORKDIR /install_dir
-RUN wget https://github.com/marbl/Mash/releases/download/v2.2/mash-Linux64-v2.2.tar &&\
-    tar -xf mash-Linux64-v2.2.tar &&\
-    rm mash-Linux64-v2.2.tar &&\
-    mv /install_dir/mash-Linux64-v2.2/mash /usr/local/bin &&\
-    rm -r mash-Linux64-v2.2
-
-
-# Install barrnap
-WORKDIR /install_dir
-RUN wget https://github.com/tseemann/barrnap/archive/0.8.tar.gz &&\
-    tar -xf 0.8.tar.gz &&\
-    rm 0.8.tar.gz &&\
-    mv /install_dir/barrnap-0.8/bin/barrnap /usr/local/bin  &&\
-    # Remove heavy useless files
-    rm -r /install_dir/barrnap-0.8/examples /install_dir/barrnap-0.8/build/*.aln
+RUN wget https://github.com/marbl/Mash/releases/download/${MASH_VER}/mash-Linux64-${MASH_VER}.tar &&\
+    tar -xf mash-Linux64-${MASH_VER}.tar &&\
+    rm mash-Linux64-${MASH_VER}.tar &&\
+    mv /install_dir/mash-Linux64-${MASH_VER}/mash /usr/local/bin &&\
+    rm -r mash-Linux64-${MASH_VER}
 
 
-# Install prodigal
-WORKDIR /install_dir
-RUN wget https://github.com/hyattpd/Prodigal/archive/v2.6.3.tar.gz &&\
-    tar -xzf v2.6.3.tar.gz &&\
-    rm v2.6.3.tar.gz
-WORKDIR /install_dir/Prodigal-2.6.3
-RUN make &&\
-    make install
-
 
 # Install dependencies for prokka:
-WORKDIR /install_dir
-RUN DEBIAN_FRONTEND="noninteractive" apt install -y\
-        libdatetime-perl \
-        libxml-simple-perl \
-        libdigest-md5-perl \
-        hmmer \
-        default-jre \
-        bioperl
-# Install hmmer
-RUN echo yes | cpan Bio::SearchIO::hmmer
-# Install bioperl
-RUN echo yes | cpan Bio::Perl
-
+# install tbl2asn manually since the one included with prokka is expired. 
+# Probably will have to do again in Dec 2021 unless Torsten removes it from prokka
+RUN wget ftp://ftp.ncbi.nih.gov/toolbox/ncbi_tools/converters/by_program/tbl2asn/linux64.tbl2asn.gz -O linux64.tbl2asn.gz && \
+    gunzip linux64.tbl2asn.gz && \
+    mv linux64.tbl2asn /usr/bin/tbl2asn && \
+    chmod 755 /usr/bin/tbl2asn
 # Install prokka
-RUN git clone https://github.com/tseemann/prokka.git
-RUN /install_dir/prokka/bin/prokka --setupdb &&\
-    ln -s /install_dir/prokka/bin/prokka /usr/local/bin
-# install tbl2asn (used by prokka)
-RUN wget -O tbl2asn.gz https://ftp.ncbi.nlm.nih.gov/asn1-converters/by_program/table2asn/linux64.table2asn.gz &&\
-    gunzip tbl2asn.gz &&\
-    chmod +x tbl2asn &&\
-    ln -s /install_dir/tbl2asn /usr/local/bin
+# RUN git clone https://github.com/tseemann/prokka.git
+# RUN /install_dir/prokka/bin/prokka --setupdb &&\
+#     ln -s /install_dir/prokka/bin/prokka /usr/local/bin
+# # install tbl2asn (used by prokka)
+# RUN wget -O tbl2asn.gz https://ftp.ncbi.nlm.nih.gov/asn1-converters/by_program/table2asn/linux64.table2asn.gz &&\
+#     gunzip tbl2asn.gz &&\
+#     chmod +x tbl2asn &&\
+#     ln -s /install_dir/tbl2asn /usr/local/bin
+RUN apt-get install -y prokka
 
+WORKDIR /install_dir
+# RUN DEBIAN_FRONTEND="noninteractive" apt install -y\
+#         libdatetime-perl \
+#         libxml-simple-perl \
+#         libdigest-md5-perl \
+#         hmmer \
+#         default-jre \
+#         bioperl
+# # Install hmmer
+# RUN echo yes | cpan Bio::SearchIO::hmmer
+# # Install bioperl
+# RUN echo yes | cpan Bio::Perl
+# # Install prokka
+RUN wget https://github.com/tseemann/prokka/archive/refs/tags/v${PROKKA_VER}.tar.gz
+RUN tar -xzf v${PROKKA_VER}.tar.gz &&\
+    rm -rf v${PROKKA_VER}.tar.gz 
+RUN /install_dir/prokka-${PROKKA_VER}/bin/prokka --setupdb &&\
+    ln -s /install_dir/prokka-${PROKKA_VER}/bin/prokka /usr/local/bin
+
+# # install tbl2asn (used by prokka)
+# RUN wget -O tbl2asn.gz https://ftp.ncbi.nlm.nih.gov/asn1-converters/by_program/table2asn/linux64.table2asn.gz &&\
+#     gunzip tbl2asn.gz &&\
+#     chmod +x tbl2asn &&\
+#     ln -s /install_dir/tbl2asn /usr/local/bin
+# more Examples/commands/2-Annotate.sh
+# PanACoTA annotate -d Examples/genomes_init -r Examples/2-res-prokka -l Examples/input_files/list_genomes.lst -n GENO --l90 3 --nbcont 10
+ 
+
+# Install prodigal
+RUN apt-get install prodigal
+# WORKDIR /install_dir
+# RUN wget https://github.com/hyattpd/Prodigal/archive/v${PRODIGAL_VER}.tar.gz &&\
+#     tar -xzf v${PRODIGAL_VER}.tar.gz &&\
+#     rm v${PRODIGAL_VER}.tar.gz
+# WORKDIR /install_dir/Prodigal-${PRODIGAL_VER}
+# RUN make 
+# RUN make install
 
 # Install MMseqs2 Version: f05f8c51d6e9c7c0b15fbd533e4b678303f50b3e
 WORKDIR /install_dir
@@ -88,34 +117,35 @@ RUN wget https://mmseqs.com/latest/mmseqs-linux-sse41.tar.gz &&\
     # remove useless files
     rm -r /install_dir/mmseqs
 
-
-# Install mafft 7.313
-RUN rm /usr/bin/mafft  # remove mafft installed with bioperl
-WORKDIR /install_dir
-RUN wget https://mafft.cbrc.jp/alignment/software/mafft-7.313-with-extensions-src.tgz &&\
-    tar xf mafft-7.313-with-extensions-src.tgz &&\
-    rm mafft-7.313-with-extensions-src.tgz
-WORKDIR /install_dir/mafft-7.313-with-extensions/core
-RUN make clean &&\
-    make &&\
-    make install
-
-
-# Install FastTree version 2.1.11 Double precision (No SSE3)
+# # Install mafft 7.313
+# RUN rm /usr/bin/mafft  # remove mafft installed with bioperl
+# WORKDIR /install_dir
+# RUN wget https://mafft.cbrc.jp/alignment/software/mafft-${MAFFT_VER}-with-extensions-src.tgz &&\
+#     tar xf mafft-7.313-with-extensions-src.tgz &&\
+#     rm mafft-7.313-with-extensions-src.tgz
+# WORKDIR /install_dir/mafft-7.313-with-extensions/core
+# RUN make clean &&\
+#     make &&\
+#     make install
+
+# # Install FastTree version 2.1.11 Double precision (No SSE3)
 WORKDIR /install_dir
 RUN wget http://www.microbesonline.org/fasttree/FastTree.c &&\
     gcc -DOPENMP -fopenmp -DUSE_DOUBLE -Wall -O3 -finline-functions -funroll-loops -o FastTreeMP FastTree.c -lm &&\
     ln -s /install_dir/FastTreeMP /usr/local/bin
 
-
 # Install FastME FastME 2.1.6.1
 WORKDIR /install_dir
 RUN apt-get install -y automake  &&\
-    git clone https://gite.lirmm.fr/atgc/FastME.git
+    git clone https://gite.lirmm.fr/atgc/FastME.git 
 WORKDIR /install_dir/FastME/tarball
 RUN tar xzf fastme-2.1.6.4.tar.gz &&\
     rm fastme-2.1.6.4.tar.gz &&\
+<<<<<<< HEAD
     ln -s /install_dir/FastME/tarball/fastme-2.1.6.2/binaries/fastme-2.1.6.4-linux64-omp /usr/local/bin/fastme
+=======
+    ln -s /install_dir/FastME/tarball/fastme-2.1.6.4/binaries/fastme-2.1.6.2-linux64-omp /usr/local/bin/fastme
+>>>>>>> dev
 
 # Install quicktree
 WORKDIR /install_dir
@@ -124,7 +154,6 @@ WORKDIR /install_dir/quicktree
 RUN make &&\
     ln -s /install_dir/quicktree/quicktree /usr/local/bin
 
-
 # Install iqtree
 WORKDIR /install_dir
 RUN wget https://github.com/Cibiv/IQ-TREE/releases/download/v1.6.12/iqtree-1.6.12-Linux.tar.gz
@@ -132,7 +161,6 @@ RUN tar -xzf iqtree-1.6.12-Linux.tar.gz &&\
     rm iqtree-1.6.12-Linux.tar.gz &&\
     ln -s /install_dir/iqtree-1.6.12-Linux/bin/iqtree /usr/local/bin
 
-
 # Install iqtree2
 WORKDIR /install_dir
 RUN wget https://github.com/Cibiv/IQ-TREE/releases/download/v2.0.6/iqtree-2.0.6-Linux.tar.gz
@@ -140,14 +168,12 @@ RUN tar -xzf iqtree-2.0.6-Linux.tar.gz &&\
     rm iqtree-2.0.6-Linux.tar.gz &&\
     ln -s /install_dir/iqtree-2.0.6-Linux/bin/iqtree2 /usr/local/bin
 
-
 # Install PanACoTA
 WORKDIR /install-dir
-RUN wget https://github.com/gem-pasteur/PanACoTA/archive/refs/tags/1.4.0.tar.gz
+RUN wget https://github.com/gem-pasteur/PanACoTA/archive/refs/tags/v1.4.0.tar.gz
 RUN tar -xzf v1.4.0.tar.gz
 WORKDIR /install-dir/PanACoTA-1.4.0
 RUN ./make
 
-
 ENTRYPOINT ["/usr/local/bin/PanACoTA"]
-CMD ['-h']
+CMD ['-h']
\ No newline at end of file