diff --git a/regtest/basic/rt-combine-periodic/Makefile b/regtest/basic/rt-combine-periodic/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..3703b27cea227aa053fb6d1d73f861e4384dbcee
--- /dev/null
+++ b/regtest/basic/rt-combine-periodic/Makefile
@@ -0,0 +1 @@
+include ../../scripts/test.make
diff --git a/regtest/basic/rt-combine-periodic/colvar.reference b/regtest/basic/rt-combine-periodic/colvar.reference
new file mode 100644
index 0000000000000000000000000000000000000000..405f78d4c76b722750687e51caa2bea8eef9d34c
--- /dev/null
+++ b/regtest/basic/rt-combine-periodic/colvar.reference
@@ -0,0 +1,11 @@
+#! FIELDS time a1 a2 p1 p2 pa1 pa2 pa1m pa2m
+#! SET min_p1 -pi
+#! SET max_p1 pi
+#! SET min_p2 -pi
+#! SET max_p2 pi
+#! SET min_pa1m -pi
+#! SET max_pa1m pi
+#! SET min_pa2m -pi
+#! SET max_pa2m pi
+ 0.000000 -1.22173 2.61799 -1.66697 3.13967 -0.445236 0.521676 -0.445236 0.521676
+ 0.050000 -1.22173 2.61799 -1.68457 -3.1278 -0.462839 -5.74579 -0.462839 0.537394
diff --git a/regtest/basic/rt-combine-periodic/config b/regtest/basic/rt-combine-periodic/config
new file mode 100644
index 0000000000000000000000000000000000000000..140a00618bbb91f8ec88aa9e7080799f075b1b7f
--- /dev/null
+++ b/regtest/basic/rt-combine-periodic/config
@@ -0,0 +1,3 @@
+type=driver
+# this is to test a different name
+arg="--plumed plumed.dat --trajectory-stride 10 --timestep 0.005 --ixyz tmp.xyz --dump-forces forces --dump-forces-fmt=%8.4f"
diff --git a/regtest/basic/rt-combine-periodic/plumed.dat b/regtest/basic/rt-combine-periodic/plumed.dat
new file mode 100644
index 0000000000000000000000000000000000000000..c5053ce55ce53d88f93166c1344ad8bf2e40f7d7
--- /dev/null
+++ b/regtest/basic/rt-combine-periodic/plumed.dat
@@ -0,0 +1,17 @@
+# some point "a" in phi/psi space
+a1: CONSTANT VALUE=-1.22173047639603070385 #-70
+a2: CONSTANT VALUE=2.61799387799149436539  #150
+# current point "p" in phi-psi space
+p1: TORSION ATOMS=5,7,9,15
+p2: TORSION ATOMS=7,9,15,17
+
+# p-a vector
+pa1: COMBINE ARG=p1,a1 COEFFICIENTS=1.,-1. PERIODIC=NO
+pa2: COMBINE ARG=p2,a2 COEFFICIENTS=1.,-1. PERIODIC=NO
+
+#trying to get a periodic p-a vector
+pa1m: COMBINE ARG=pa1 COEFFICIENTS=1. PERIODIC=-pi,pi 
+pa2m: COMBINE ARG=pa2 COEFFICIENTS=1. PERIODIC=-pi,pi 
+
+PRINT ARG=a1,a2,p1,p2,pa1,pa2,pa1m,pa2m  STRIDE=1 FMT=%g FILE=colvar
+
diff --git a/regtest/basic/rt-combine-periodic/tmp.xyz b/regtest/basic/rt-combine-periodic/tmp.xyz
new file mode 100644
index 0000000000000000000000000000000000000000..a7ed437f92d2a94c7f161c358b7a4991eb6807d1
--- /dev/null
+++ b/regtest/basic/rt-combine-periodic/tmp.xyz
@@ -0,0 +1,48 @@
+22
+ generated by VMD
+ C         7.426660        1.175157        5.521920
+ H         7.826973        0.198052        5.201265
+ H         6.701839        1.373954        4.710052
+ H         6.852031        1.068966        6.450162
+ C         8.491815        2.219806        5.666954
+ O         9.204520        2.159070        4.639861
+ N         8.627721        3.240756        6.604086
+ H         8.070031        3.064171        7.411407
+ C         9.705361        4.297344        6.626343
+ H         9.972519        4.030229        5.608061
+ C         9.122450        5.787033        6.539737
+ H         9.974642        6.390628        6.198587
+ H         8.773165        6.213179        7.495877
+ H         8.400371        5.922006        5.680896
+ C        10.867927        4.068889        7.454099
+ O        10.797208        3.139278        8.218799
+ N        11.849608        5.051494        7.459472
+ H        11.425094        5.790774        6.972304
+ C        13.055787        4.954424        8.148125
+ H        13.163018        4.103357        8.702283
+ H        13.204816        5.877514        8.754676
+ H        13.846210        5.023830        7.438193
+22
+ generated by VMD
+ C         7.424259        1.175460        5.521116
+ H         7.835259        0.209655        5.175528
+ H         6.705950        1.400984        4.719906
+ H         6.868944        1.071771        6.471955
+ C         8.498229        2.230016        5.672456
+ O         9.202964        2.162216        4.644840
+ N         8.626006        3.241682        6.614517
+ H         8.095504        3.061236        7.451256
+ C         9.713079        4.300539        6.617662
+ H         9.974644        4.047624        5.600792
+ C         9.123056        5.776693        6.541171
+ H         9.995579        6.372286        6.197186
+ H         8.749353        6.196899        7.491727
+ H         8.418746        5.948982        5.668446
+ C        10.866976        4.075941        7.446161
+ O        10.793647        3.133207        8.213814
+ N        11.839444        5.045859        7.457207
+ H        11.427945        5.823356        6.979874
+ C        13.060909        4.959161        8.150963
+ H        13.153873        4.067696        8.730364
+ H        13.182820        5.891395        8.753601
+ H        13.859556        5.012844        7.405939