diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6d399d76732379ea6c47be5f37e097573c478b26..b67a8dfb7aa44ea2173ccb85d95b1d83ebcac37f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,4 @@
-image: docker.io/labrobotica/labrobotica
+image: docker.io/labrobotica/labrobotica:latest
 
 stages:
   - build
@@ -8,10 +8,9 @@ stages:
 build-package:
   stage: build
   script:
+    - apt update || apt -y install ca-certificates && apt update
 #  Uncomment to install dependencies
-#    - apt update
 #    - apt -y install iri-<package_name>-dev
-    - apt update
     - apt -y install iri-iriutils-dev
     - apt install -y libxerces-c-dev xsdcxx
     - mkdir -pv build
@@ -30,7 +29,7 @@ update_repo:
   script:
     - cd build
     - "scp -i /root/.ssh/iriLabKeyNopwd -r *trajectory*.deb irilabo@labrepo.iri.upc.edu:packages/"
-    - "ssh irilabo@labrepo.iri.upc.edu -i /root/.ssh/iriLabKeyNopwd -tt /home/irilabo/repo_scripts/update_repo.sh trajectory"
+    - "ssh irilabo@labrepo.iri.upc.edu -i /root/.ssh/iriLabKeyNopwd -tt /home/irilabo/repo_scripts/update_repo.sh trajectory $(lsb_release -cs)"
   only:
     - tags
 
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f9dadf6f1a89a0efbf33f6a33e0095016e1d50d..163a0573ed251a06913d90a0ae8aa0dd0b70437b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,7 +85,7 @@ IF (UNIX)
   SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "labrobotica - labrobotica@iri.upc.edu")
 
 # Uncomment to add the necessary mantainer scripts
-#   SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/package_scripts/preinst;${CMAKE_SOURCE_DIR}/package_scripts/postinst;${CMAKE_SOURCE_DIR}/package_scripts/prerm;${CMAKE_SOURCE_DIR}/package_scripts/postrm")
+  SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/scripts/debian/postinst;${CMAKE_SOURCE_DIR}/scripts/debian/prerm")
 
 # Uncomment to add dependencies comma separated
 # SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-<package_name>-dev (>= 1.0~${DISTRIB})")
diff --git a/include/trajectory.h b/include/trajectory.h
index f8ac075dcf371df85060ca1553a33af1a45e745b..54743f6a54f04a4032d5daeb9303c85f715535cd 100644
--- a/include/trajectory.h
+++ b/include/trajectory.h
@@ -623,7 +623,7 @@ class CTrajectory
 	  }
 	  // load the new trajectory
           std::cout << "read file " << filename << std::endl;
-	  std::auto_ptr<traj_t> traj(trajectory(filename.c_str(),xml_schema::flags::dont_validate));
+	  std::unique_ptr<traj_t> traj(trajectory(filename.c_str(),xml_schema::flags::dont_validate));
 	  if(traj->num_motors()!=(this->motor_control->*this->get_num_motors_fnct)())
 	  {
 	    this->motion_access.exit();
diff --git a/scripts/debian/postinst b/scripts/debian/postinst
new file mode 100755
index 0000000000000000000000000000000000000000..eb8861e5a36d5fef847768993d602ecbf1648b17
--- /dev/null
+++ b/scripts/debian/postinst
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -e
+
+case "$1" in
+  configure)
+    echo "   Trying to add library to ldconfig..."
+    /usr/share/iri/add_lib_to_ld_config.sh -l trajectory -p && echo "   Done." || echo "   /usr/share/iri/add_lib_to_ld_config.sh doesn't exists. Download it from iriutils and execute it."
+    
+  ;;
+  abort-upgrade)
+
+  ;;
+  abort-remove)
+
+  ;;
+  abort-deconfigure)
+
+  ;;
+esac   
+
+exit 0
diff --git a/scripts/debian/prerm b/scripts/debian/prerm
new file mode 100644
index 0000000000000000000000000000000000000000..debb757e03f40650f34d52e041f8dd41d2389363
--- /dev/null
+++ b/scripts/debian/prerm
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -e
+
+case "$1" in
+  remove)
+    echo "   Trying to remove library from ldconfig..."
+    /usr/share/iri/remove_lib_from_ld_config.sh -l trajectory -p && echo "   Done." || echo "   /usr/share/iri/remove_lib_from_ld_config.sh doesn't exists. Download it from iriutils and execute it."
+
+  ;;
+  upgrade)
+
+  ;;
+  deconfigure)
+
+  ;;
+  failed-upgrade)
+
+  ;;
+esac    
+
+exit 0
diff --git a/src/xml/CMakeLists.txt b/src/xml/CMakeLists.txt
index 8de9af83fed294b0ce3837c191fc291147e9f487..9f35d7d4aeb38f9aa5624db2c1cdfd2c813a6522 100644
--- a/src/xml/CMakeLists.txt
+++ b/src/xml/CMakeLists.txt
@@ -36,7 +36,7 @@ IF(XSD_FOUND)
       ADD_CUSTOM_TARGET(xsd_files_gen DEPENDS ${XSD_SOURCES_INT})
       ADD_CUSTOM_COMMAND(
          OUTPUT ${XSD_SOURCES_INT}
-         COMMAND xsdcxx cxx-tree --generate-serialization ${XSD_FILES}
+         COMMAND xsdcxx cxx-tree --std c++11 --generate-serialization ${XSD_FILES}
          WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
          DEPENDS ${XSD_PATH_FILES}
          COMMENT "Parsing the xml template file ${XSD_FILES}")