diff --git a/.gitattributes b/.gitattributes
index 27be6b2a9d6722cb6775eca1f172f2b1d93da365..f564c09a1120063af993145eb83ef2b39eff71f7 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2196,6 +2196,7 @@ CMake/FindOpenCL.cmake -text
 CMake/FindValgrind.cmake -text
 CMake/LofarPackageList.cmake eol=lf
 CMake/TODO -text
+CMake/get_casacore_deps.sh eol=lf
 CMake/testscripts/assay -text
 CMake/testscripts/checkfloat -text
 CMake/testscripts/default.debug -text
diff --git a/CEP/LMWCommon/test/CMakeLists.txt b/CEP/LMWCommon/test/CMakeLists.txt
index 2fb18c6adea5a40d1dee8c9ffbde1a687a3273e6..1a4c98e1aa8db73727f0175d7990cf4d34cbf84b 100644
--- a/CEP/LMWCommon/test/CMakeLists.txt
+++ b/CEP/LMWCommon/test/CMakeLists.txt
@@ -12,3 +12,9 @@ lofar_add_test(tSocketConnectionSet tSocketConnectionSet.cc)
 lofar_add_test(tfinddproc DEPENDS finddproc)
 lofar_add_test(tstartdproc tstartdproc.cc)
 lofar_add_test(trundist)
+
+# The SocketConnection tests must be run serially
+set_tests_properties(
+  tSocketConnection
+  tSocketConnectionSet
+  PROPERTIES RUN_SERIAL ON)
\ No newline at end of file
diff --git a/CMake/FindCasacore.cmake b/CMake/FindCasacore.cmake
index 37f008b9c3dd1e44d291a178dd49868a8c5eebc1..34cad20b160a797d4dfd3bfc5d07229afdcfe259 100644
--- a/CMake/FindCasacore.cmake
+++ b/CMake/FindCasacore.cmake
@@ -2,26 +2,18 @@
 # Usage:
 #   find_package(Casacore [REQUIRED] [COMPONENTS components...])
 # Valid components are:
-#   casa, scimath_f, scimath, tables, measures, measures_f, lattices,
-#   fits, ms, coordinates, msfits, components, mirlib, images
+#   casa, components, coordinates, derivedmscal, fits, images, lattices,
+#   meas, measures, mirlib, ms, msfits, scimath, scimath_f, tables
 #
 # Note that most components are dependent on other (more basic) components.
 # In that case, it suffices to specify the "top-level" components; dependent
 # components will be searched for automatically.
 #
-# Here's the dependency tree:
-#   scimath_f    ->  casa
-#   scimath      ->  scimath_f
-#   tables       ->  casa
-#   measures     ->  scimath, tables
-#   measures_f   ->  scimath, tables
-#   lattices     ->  scimath, tables
-#   fits         ->  measures
-#   ms           ->  measures
-#   coordinates  ->  fits
-#   msfits       ->  fits, ms
-#   components   ->  coordinates
-#   images       ->  components, mirlib, lattices
+# The dependency tree can be generated using the script get_casacore_deps.sh.
+# For this, you need to have a complete casacore installation, built with shared
+# libraries, at your disposal.
+#
+# The dependencies in this macro were generated against casacore release 1.7.0.
 #
 # Variables used by this module:
 #  CASACORE_ROOT_DIR         - Casacore root directory. 
@@ -148,17 +140,17 @@ macro(casacore_find_package _name)
   endif(${_name}_FOUND)
 endmacro(casacore_find_package _name)
 
-
 # Define the Casacore components.
 set(Casacore_components
   casa
   components
   coordinates
+  derivedmscal
   fits
   images
   lattices
+  meas
   measures
-  measures_f
   mirlib
   ms
   msfits
@@ -168,18 +160,21 @@ set(Casacore_components
 )
 
 # Define the Casacore components' inter-dependencies.
-set(Casacore_components_DEPENDENCIES  coordinates)
-set(Casacore_coordinates_DEPENDENCIES fits)
-set(Casacore_fits_DEPENDENCIES        measures)
-set(Casacore_images_DEPENDENCIES      components lattices mirlib)
-set(Casacore_lattices_DEPENDENCIES    scimath tables)
-set(Casacore_measures_DEPENDENCIES    scimath tables)
-set(Casacore_measures_f_DEPENDENCIES  scimath tables)
-set(Casacore_ms_DEPENDENCIES          measures)
-set(Casacore_msfits_DEPENDENCIES      fits ms)
-set(Casacore_scimath_DEPENDENCIES     scimath_f)
-set(Casacore_scimath_f_DEPENDENCIES   casa)
-set(Casacore_tables_DEPENDENCIES      casa)
+set(Casacore_casa_DEPENDENCIES)
+set(Casacore_components_DEPENDENCIES    coordinates measures scimath tables casa)
+set(Casacore_coordinates_DEPENDENCIES   fits measures casa)
+set(Casacore_derivedmscal_DEPENDENCIES  ms measures tables casa)
+set(Casacore_fits_DEPENDENCIES          measures tables casa)
+set(Casacore_images_DEPENDENCIES        mirlib components lattices coordinates fits measures scimath tables casa)
+set(Casacore_lattices_DEPENDENCIES      tables scimath casa)
+set(Casacore_meas_DEPENDENCIES          measures tables casa)
+set(Casacore_measures_DEPENDENCIES      tables casa)
+set(Casacore_mirlib_DEPENDENCIES)
+set(Casacore_ms_DEPENDENCIES            measures scimath tables casa)
+set(Casacore_msfits_DEPENDENCIES        ms fits measures tables casa)
+set(Casacore_scimath_DEPENDENCIES       scimath_f casa)
+set(Casacore_scimath_f_DEPENDENCIES)
+set(Casacore_tables_DEPENDENCIES        casa)
 
 # Initialize variables.
 set(CASACORE_FOUND FALSE)
diff --git a/CMake/get_casacore_deps.sh b/CMake/get_casacore_deps.sh
new file mode 100755
index 0000000000000000000000000000000000000000..9dff17dfc3c85efa1b8fc7e95ac822f37413ca02
--- /dev/null
+++ b/CMake/get_casacore_deps.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+# 
+# Derive casacore dependencies from the installed shared libraries.
+
+# Location to search for casacore shared libraries.
+CASACORE_LIBDIR=${1:-/opt/lofar/external/casacore/lib}
+
+# Make sure that we get a deterministic lexicograhical ordering.
+LC_ALL=C
+
+# Expand to null string if no files match glob pattern
+shopt -s nullglob
+
+echo "Searching for libraries in $CASACORE_LIBDIR ..." 1>&2
+
+echo "# Define the Casacore components."
+echo "set(Casacore_components"
+for f in $CASACORE_LIBDIR/*.so
+do
+  comp=$(echo ${f%%.so} | sed 's,^.*libcasa_,,')
+  echo "  $comp"
+done
+echo ")"
+echo
+echo "# Define the Casacore components' inter-dependencies."
+for f in $CASACORE_LIBDIR/*.so
+do
+  comp=$(echo ${f%%.so} | sed 's,^.*libcasa_,,')
+  printf "%-39s" "set(Casacore_${comp}_DEPENDENCIES "
+  libs=$(readelf -d $f | grep 'NEEDED.*libcasa_' | \
+         sed -e 's,^[^\[]*\[libcasa_,,' -e 's,\..*$,,')
+  for l in $libs
+  do
+    printf " %s" "$l"
+  done
+  printf ")\n"
+done