diff --git a/TODO b/TODO
index 8df0ff44427c788f8ffc47fecfe71915244b03a1..46e947fdcd53351b43e76de36a80233006151a3c 100644
--- a/TODO
+++ b/TODO
@@ -1,7 +1,5 @@
 == BUGS ==
 
-p1[k,0,0] should raise error
-
 expr.cpp: get_k, get_j should allow i dependence
   <= needs major modif in node.cpp
 
@@ -11,6 +9,8 @@ FSel - nach fdel, fx
 
 history: RETURN not stored
 
+curve: mfj, cp funzt noch nicht
+
 == CLEANUP ==
 
 - read-plus Interface in EINEN namespace ask:: stecken
diff --git a/pub/configure b/pub/configure
index 4076b58bd72397e108f8442acb574419c9d1cdac..eb3bbe071c4192adfcad78882eb4fb70325d13c6 100755
--- a/pub/configure
+++ b/pub/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for frida 2.1.7b.
+# Generated by GNU Autoconf 2.69 for frida post-2.1.7b.
 #
 # Report bugs to <j.wuttke@fz-juelich.de>.
 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='frida'
 PACKAGE_TARNAME='frida'
-PACKAGE_VERSION='2.1.7b'
-PACKAGE_STRING='frida 2.1.7b'
+PACKAGE_VERSION='post-2.1.7b'
+PACKAGE_STRING='frida post-2.1.7b'
 PACKAGE_BUGREPORT='j.wuttke@fz-juelich.de'
 PACKAGE_URL=''
 
@@ -1284,7 +1284,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures frida 2.1.7b to adapt to many kinds of systems.
+\`configure' configures frida post-2.1.7b to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1350,7 +1350,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of frida 2.1.7b:";;
+     short | recursive ) echo "Configuration of frida post-2.1.7b:";;
    esac
   cat <<\_ACEOF
 
@@ -1446,7 +1446,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-frida configure 2.1.7b
+frida configure post-2.1.7b
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2120,7 +2120,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by frida $as_me 2.1.7b, which was
+It was created by frida $as_me post-2.1.7b, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2943,7 +2943,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='frida'
- VERSION='2.1.7b'
+ VERSION='post-2.1.7b'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -7639,7 +7639,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by frida $as_me 2.1.7b, which was
+This file was extended by frida $as_me post-2.1.7b, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -7705,7 +7705,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-frida config.status 2.1.7b
+frida config.status post-2.1.7b
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/pub/src/STYLE b/pub/src/STYLE
index eb7f50bfada7c52d84830a58478adbe27a8d7f20..a57f8dfe0e4c8ad4e12414736808542d6952205c 100644
--- a/pub/src/STYLE
+++ b/pub/src/STYLE
@@ -1,3 +1,7 @@
+== checks ==
+
+cpplint.py --counting=detailed [a-v,z]*.*[ph] 2> ~/h
+
 == include's ==
 
 - Block 1: Standard software
@@ -29,4 +33,3 @@
 
 - "const" with pointer arguments is poorly understood (even less so with
   shared_ptr)
-
diff --git a/pub/src/axis.cpp b/pub/src/axis.cpp
index 89ac46921504037cdd222921898b183346dd1d01..f247290a914c89f8d412271c22d67af5a134a60e 100644
--- a/pub/src/axis.cpp
+++ b/pub/src/axis.cpp
@@ -76,7 +76,7 @@ void CAxis::ask_and_set( const string& quest )
         } else if ( resp1 == "\\EOL" ) {
             inf_in = inf;
         } else if( triv::any2dbl(resp1,&inf_in) ) {
-            ; // ok
+            // ok
         } else {
             cout << "required input: plot axis range\n"
                 "examples:\n"
@@ -99,7 +99,7 @@ void CAxis::ask_and_set( const string& quest )
         } else if ( resp2 == "" || resp2 == "\\EOL" ) {
             sup_in = sup;
         } else if( triv::any2dbl(resp2,&sup_in) ) {
-            ; // ok
+            // ok
         } else {
             cout << "invalid upper bound; use '?' for help\n";
             continue;
diff --git a/pub/src/axis.h b/pub/src/axis.h
index 259b6927ee518eb3ba6e0346885fddd912cc8b16..b3e528fe7175af07113a21fa0898ac80756e7780 100644
--- a/pub/src/axis.h
+++ b/pub/src/axis.h
@@ -16,7 +16,7 @@ class CAxis {
     bool   force;
 
     CAxis( bool _log ) :
-        logflag(_log), force(false) { setAuto(); };
+        logflag(_log), force(false) { setAuto(); }
 
     void setLog( bool _log );
 
diff --git a/pub/src/curve.cpp b/pub/src/curve.cpp
index ad69b2cb23e7edcd2f7e7f1e6afd6aedd38d22fd..bc8fb03032ad560abf1bdcc246f38a6507dd2ed2 100644
--- a/pub/src/curve.cpp
+++ b/pub/src/curve.cpp
@@ -103,7 +103,7 @@ void COlc::parseFunction( const string& _expr )
 
 void COlc::askCurve( const string& quest )
 {
-ask_again:
+ ask_again:
     string resp = sask( quest+" (or e(c|i)(r|w); h for help) ?" );
     if        ( resp=="h" ) {
         cout <<
diff --git a/pub/src/dualplot.h b/pub/src/dualplot.h
index aa86b8f4dc5b11ea5d21929823b04d500be031b7..6b1a949c03cf7c8928c5c9a6c9a6730c319325e5 100644
--- a/pub/src/dualplot.h
+++ b/pub/src/dualplot.h
@@ -55,6 +55,7 @@ private:
     vector<string> ps_accu; // future output is accumulated here
 };
 
+
 //! Direct access to plot windows collection.
 
 namespace NPloWin {
diff --git a/pub/src/edif.cpp b/pub/src/edif.cpp
index a8a3ffcb57800e0a613d576bfe262adfaabbe9bf..c9d308e56405b8ae16d8abf3d8cec5d819050a42 100644
--- a/pub/src/edif.cpp
+++ b/pub/src/edif.cpp
@@ -175,7 +175,7 @@ void NEdif::ShowNumpar()
         cout << "# file " << fiter.k() << ":\n";
         for ( uint m=0; m<f->RPar.size(); m++ ) {
             cout << "  " << f->RPar[m].Co.str_compact() << ": " <<
-                f->RPar[m].val << "\n" ;
+                f->RPar[m].val << "\n";
         }
     }
 }
diff --git a/pub/src/expr.h b/pub/src/expr.h
index b6c11bbf960475213fe95c964e62e2f3e2abd616..d85a8acff422055747ae150d8a613c1c835e4855 100644
--- a/pub/src/expr.h
+++ b/pub/src/expr.h
@@ -45,21 +45,21 @@ class CResult {
     vector<double> v;
     vector<double> dv;
 
-    CResult() : vectorial(false), dr(0) {};
+    CResult() : vectorial(false), dr(0) {}
 
     void set_r( double _r ) {
-        vectorial = false; r = _r; };
+        vectorial = false; r = _r; }
     void preset_v( int n ) {
-        vectorial = true; v.resize(n); };
+        vectorial = true; v.resize(n); }
     void set_v( const vector<double>& _v ) {
-        vectorial = true; v = _v; };
+        vectorial = true; v = _v; }
 
     double to_r( int i ) const {
-        return vectorial ? v[i] : r; };
+        return vectorial ? v[i] : r; }
     double to_dr( int i ) const {
-        return vectorial ? ( dv.size() ? dv[i] : 0 ) : dr; };
+        return vectorial ? ( dv.size() ? dv[i] : 0 ) : dr; }
     bool has_err() const {
-        return vectorial ? dv.size() : dr; };
+        return vectorial ? dv.size() : dr; }
 
     string result_info() const;
 };
@@ -74,7 +74,7 @@ class CRef {
     PNode ti;
 
     CRef( PNode _tk=PNode(), PNode _tj=PNode(), PNode _ti=PNode() ) 
-        : tk(_tk), tj(_tj), ti(_ti) {};
+        : tk(_tk), tj(_tj), ti(_ti) {}
     
     uint get_k( const CContext& ctx ) const;
     uint get_j( const CContext& ctx, uint nj ) const;
diff --git a/pub/src/jsel.cpp b/pub/src/jsel.cpp
index cd552c1c5c5d9b251cf9be6e0069a2733c5b84ee..d6942965dfa372ab08b33e6d84c776a325fc330d 100644
--- a/pub/src/jsel.cpp
+++ b/pub/src/jsel.cpp
@@ -9,6 +9,7 @@
 
 #include <string>
 #include <vector>
+#include <algorithm>
 
 #include <read-plus/ask.hpp>
 
diff --git a/pub/src/list.cpp b/pub/src/list.cpp
index 0c3a668aa5fd807a1cf3d2fd158a83bc723e3131..63e4f4466cdf4bb94c82be2d596821cc956c20b0 100644
--- a/pub/src/list.cpp
+++ b/pub/src/list.cpp
@@ -8,6 +8,7 @@
 //! \brief index collection CList
 
 #include <iostream>
+#include <string>
 #include <vector>
 #include <algorithm>
 
diff --git a/pub/src/list.h b/pub/src/list.h
index d3ad41a55b3bbfb9da8891033cd05f9711d09005..cf988be61f3cdc7b3732691cbefb67f12f9a5a6f 100644
--- a/pub/src/list.h
+++ b/pub/src/list.h
@@ -64,12 +64,12 @@ public:
 
     // inspect:
     bool evaluated() const { return !limneeded || limgiven; }
-    uint size() const { return V.size(); };
+    uint size() const { return V.size(); }
     bool contains( uint val ) const;
     bool all_between( int imi, int ima );
     string str() const;
     friend ostream& operator<< ( ostream& s, CList L ) {
-        return s << L.str(); };
+        return s << L.str(); }
 
 private:
     void parse( string inp );
diff --git a/pub/src/manip.cpp b/pub/src/manip.cpp
index 1c732be7a69eb72f7b8d63ef9a4403ab4e7d136c..43908b9e318ad872062c37b180c3ed97bd311b30 100644
--- a/pub/src/manip.cpp
+++ b/pub/src/manip.cpp
@@ -71,7 +71,6 @@ void NManip::ProtectSpecs( bool on )
 void NManip::PtsSelect( bool sel_del )
 {
     NOlm::IterateD fiter;
-
     static string pSel = "";
     pSel = wask( string( sel_del ? "Delete" : "Retain" ) +
                  " which points", pSel );
@@ -161,7 +160,6 @@ void NManip::PtsAvge()
 void NManip::PtsAvgeFixed()
 {
     NOlm::IterateD fiter;
-
     static int ng=2;
     ng = iask( "Number of points per bin", ng );
     if ( ng<1 )
@@ -204,7 +202,6 @@ void NManip::PtsAvgeFixed()
 void NManip::PtsAvgeByErr( const string& subcmd )
 {
     NOlm::IterateD fiter;
-
     bool mode_abs;
     if      ( subcmd=="a" )
         mode_abs = true;
@@ -263,7 +260,6 @@ void NManip::PtsAvgeByErr( const string& subcmd )
 void NManip::PtsSort()
 {
     NOlm::IterateD fiter;
-
     string expr = sask("Sort points according to");
     if (expr=="") return;
     PNode T = user_xaxparse( expr.c_str() );
@@ -348,7 +344,6 @@ void NManip::PtsAvgeEq(void)
 void NManip::PtsSymmetrize()
 {
     NOlm::IterateD fiter;
-
     static string expr = "0";
     expr = sask( "Assume symmetry with mirror positioned at", expr );
     if ( expr=="" ) return;
@@ -387,7 +382,6 @@ void NManip::PtsSymmetrize()
                 else
                     sout->push_xy( ( -sin->x[il-i] + sin->x[ih+i] ) / 2,
                                    ( sin->y[il-i] + sin->y[ih+i] ) / 2 );
-
             }
             if( nl<nh ){
                 for (i=nl; i<nh; ++i)
@@ -560,7 +554,6 @@ void NManip::ScaAvge()
 void NManip::ScaJoin()
 {
     NOlm::IterateD fiter;
-
     CList JSel;
     static string jSel = "";
     JSelAsk( "Start groups at spectra", &jSel, &JSel );
@@ -599,7 +592,6 @@ void NManip::ScaJoin()
 void NManip::ScaSpawn()
 {
     NOlm::IterateO fiter;
-
     static int njj = 2;
     int njjIn = iask("output will have how many copies of input spectrum", njj);
     if (njjIn<1) return;
@@ -647,7 +639,6 @@ void NManip::ScaExch()
         uint ji, jf;
 
         for ( ji=0; ji<fin->nJ(); ) {
-
             zcommon.clear();
             for ( uint i=0; i<izco; ++i)
                 zcommon.push_back(fin->V[ji]->z[i]);
@@ -707,7 +698,6 @@ void NManip::ScaExch()
 void NManip::ScaSortByExpr()
 {
     NOlm::IterateO fiter;
-
     string expr = sask("Sort spectra according to");
     if (expr=="") return;
     PNode T = user_xaxparse( expr.c_str() );
@@ -752,7 +742,6 @@ void NManip::ScaSortByZ()
 void NManip::ZExchange()
 {
     NOlm::IterateO fiter;
-
     int nzmin, nzmax = 0;
     char mod;
     string com;
@@ -855,7 +844,6 @@ void NManip::ZExchange()
 void NManip::ZDelete()
 {
     NOlm::IterateO fiter;
-
     string sel;
     sel = wask( "List of z coordinates to be removed" );
     if ( sel=="-" )
@@ -934,7 +922,6 @@ void NManip::ScaBreak()
 void NManip::FilMerge( const string& opts )
 {
     NOlm::IterateO fiter;
-
     // parse options:
     bool add_zk = false;
     if ( opts=="+" )
@@ -967,6 +954,8 @@ void NManip::FilMerge( const string& opts )
     fout->xco = fin->xco;
     fout->yco = fin->yco;
     fout->ZCo = fiter()->ZCo;
+    if ( POlc fc = P2C(fin) )
+        P2C(fout)->PCo = fc->PCo;
     while ( fin = fiter() ){
         if ( fin->xco != fout->xco )
             throw "different x coordinates";
@@ -977,6 +966,9 @@ void NManip::FilMerge( const string& opts )
         for ( uint i=0; i<fout->ZCo.size(); ++i )
             if ( fin->ZCo[i] != fout->ZCo[i] )
                 throw "different z"+S(i)+" coordinate";
+        if ( POlc fc = P2C(fin) )
+            if ( fc->PCo.size() != P2C(fout)->PCo.size() )
+                throw "different numer of curve parameters";
     }
 
     // check RPar, and prepare move to z if they differ:
@@ -1088,7 +1080,6 @@ void NManip::FilMerge( const string& opts )
 void NManip::FilMergePointwise()
 {
     NOlm::IterateD fiter;
-
     // Copy first input file:
     POld fin = fiter();
     POld fout( fin->new_old() );
diff --git a/pub/src/mem.cpp b/pub/src/mem.cpp
index fd22dc3eab2c7ac32617f8481e916533e490fdbb..98ea67a8f622b7a27dc7b0a8d2aaaf9be414be39 100644
--- a/pub/src/mem.cpp
+++ b/pub/src/mem.cpp
@@ -203,7 +203,7 @@ namespace NOlm {
     {
         IterateD iter2;
         uint ret = 0;
-        for( ; iter2(); ++ret );
+        for( ; iter2(); ++ret ) {};
         return ret;
     }
 
@@ -218,7 +218,7 @@ namespace NOlm {
     {
         IterateC iter2;
         uint ret = 0;
-        for( ; iter2(); ++ret );
+        for( ; iter2(); ++ret ) {};
         return ret;
     }
 }
diff --git a/pub/src/mem.h b/pub/src/mem.h
index 5a351e4dc2e4fe1b2f2ebc4b6384ee207f22961c..99a27fc3b210f0072acc2f5759375f608cfe27c7 100644
--- a/pub/src/mem.h
+++ b/pub/src/mem.h
@@ -75,4 +75,4 @@ namespace NOlm {
 
     //! Allow command to overwrite its input files?
     extern bool overwrite;
-};
+};  // namespace NOlm
diff --git a/pub/src/node.cpp b/pub/src/node.cpp
index 24ca20019e8f3d276ead9ab305ecd97c3bd2799a..6e1b7fa3ef0ce92acc9b48cc449d2c62296ef0b6 100644
--- a/pub/src/node.cpp
+++ b/pub/src/node.cpp
@@ -11,6 +11,7 @@
 #include <iostream>
 #include <string>
 #include <vector>
+#include <algorithm>
 
 #include "defs.h"
 #include "olf.h"
@@ -273,9 +274,13 @@ void CNodeIva::tree_val( CResult& ret, const CContext& ctx ) const
 
     // Return k-j-dependent reference (unless done above):
     if        ( var->typ == CVar::_J ) {
+        if ( ref->ti )
+            throw "J does not require 3 indices";
         ret.set_r( ctx.j );
         return;
     } else if ( var->typ == CVar::_Z ) {
+        if ( ref->ti )
+            throw "Z does not require 3 indices";
         if ( var->num>= f->nZ() )
             throw "invalid reference " + var->var_info();
         ret.set_r( f->V[j]->z[var->num] );
@@ -372,10 +377,14 @@ void CNodeIva::tree_val( CResult& ret, const CContext& ctx ) const
     if ( fc ) {
         PCurve cj = fc->VC(j);
         if       ( var->typ == CVar::_CP ) {
+            if ( ref->ti )
+                throw "P does not require 3 indices";
             if ( var->num>= fc->nP )
                 throw "invalid p ref(" + var->var_info() + ") in curve file";
             ret.set_r( cj->P[var->num] );
         } else if ( var->typ == CVar::_CQ ) {
+            if ( ref->ti )
+                throw "Q does not require 3 indices";
             if ( var->num >= CCurve::mQuality )
                 throw "invalid fm ref(" + var->var_info() + ") in curve file";
             ret.set_r( cj->Quality[var->num] );
@@ -433,8 +442,7 @@ void CNodeIva::set_coord( CCoord& ret, uint k_in ) const
             else if  ( var->typ == CVar::_NI )
                 ret = CCoord("#points", "");
             else
-                throw "reference " + var->var_info() +
-                    " not allowed in data file";
+                throw "data file has no " + var->var_info();
         } else if ( fc ) {
             if     ( var->typ == CVar::_CP ) {
                 if( var->num>=fc->nP )
@@ -445,8 +453,7 @@ void CNodeIva::set_coord( CCoord& ret, uint k_in ) const
             else if ( var->typ == CVar::_C )
                 ret = CCoord(fc->expr,"");
             else
-                throw "reference " + var->var_info() +
-                    " not allowed in curve file";
+                throw "curve file has no " + var->var_info();
         } else
             throw "BUG: ref->set_coord unexpected else";
     }
diff --git a/pub/src/node.h b/pub/src/node.h
index 74a379b44f6d9f5414981c029aea2aa44d8b65e5..295a8e2a997dd7d6b256fc95da9fc1f8a40aab5f 100644
--- a/pub/src/node.h
+++ b/pub/src/node.h
@@ -57,7 +57,7 @@ class CNodeIva: public CNode {
     void npar_exec( uint *np ) const;
  public:
     CNodeIva( PVar _var, PRef _ref=PRef( new CRef() ) ) 
-        : var(_var), ref(_ref) {};
+        : var(_var), ref(_ref) {}
     void tree_val( CResult& ret, const CContext& ctx ) const;
     bool has_dummy() const { return false; }
     bool has_conv() const { return false; }
@@ -89,7 +89,7 @@ class CNodeDummy: public CNode {
  private:
     void npar_exec( uint *np ) const {;}
  public:
-    CNodeDummy() {};
+    CNodeDummy() {}
     void tree_val( CResult& ret, const CContext& ctx ) const {
         if ( !(ctx.vt) ) throw "BUG: tree_val with *vt=0";
         ret.set_v( *(ctx.vt) ); }
diff --git a/pub/src/olf.h b/pub/src/olf.h
index d1cb7c5bf83c86b1b499015a1d618f08be04818f..cf495272a514fd526a2f9c967de53d28102e8d92 100644
--- a/pub/src/olf.h
+++ b/pub/src/olf.h
@@ -26,18 +26,18 @@ class COlo {
     // Online state records:
     bool as_on_disk;
 
-    COlo() : as_on_disk(false) {};
-    virtual ~COlo() {}; ///< magic: makes dynamic_cast possible
+    COlo() : as_on_disk(false) {}
+    virtual ~COlo() {} ///< magic: makes dynamic_cast possible
 
-    void clear() { V.clear(); };
-    void remove( uint j ) { V.erase( V.begin()+j ); };
+    void clear() { V.clear(); }
+    void remove( uint j ) { V.erase( V.begin()+j ); }
     void remove_z( uint iz );
     string infoLine( uint j ) const;
 
     virtual void copy_mainvec( POlo fin ) = 0;
 
-    uint nJ() const { return V.size(); };
-    uint nZ() const { return ZCo.size(); };
+    uint nJ() const { return V.size(); }
+    uint nZ() const { return ZCo.size(); }
     double z( uint j, uint iz ) const;
     virtual PZentry new_zentry( uint j ) const = 0;
     virtual POlo new_olo( bool modified=true ) const = 0;
@@ -50,8 +50,8 @@ class COlo {
 
 class COld : public COlo {
  public:
-    COld() {};
-    COld( class COlc const* fc );
+    COld() {}
+    explicit COld( class COlc const* fc );
 
     // Trivially duplicated functions:
     PSpec VS( uint j ) const;
@@ -64,7 +64,7 @@ class COld : public COlo {
     uint nPts(uint j) const; 
     uint nPts() const; // 0 unless all spectra j have same nPts(j)
     CCoord coord( class CVar* var ) const;
-    void setCoord( class CVar* var, CCoord& co ) ;
+    void setCoord( class CVar* var, CCoord& co );
 };
 
 
@@ -97,7 +97,7 @@ class COlc : public COlo {
     PNode range_T;        ///< Restricts points to be fitted (parsed tree).
 
     COlc() :
-        kconv(-1), weighing( _ERR ), plot_to_grid( false ), range_expr("") {};
+        kconv(-1), weighing( _ERR ), plot_to_grid( false ), range_expr("") {}
 
     // Trivially duplicated functions:
     PCurve VC( uint j ) const;
@@ -112,7 +112,7 @@ class COlc : public COlo {
     string infoScanHeader() const;
     string pInfoCat() const;
     CCoord coord( class CVar* var ) const;
-    void setCoord( class CVar* var, CCoord& co ) ;
+    void setCoord( class CVar* var, CCoord& co );
 
     // The following nontrivial function are implemented in curve.cpp:
     void curveDefaults();
diff --git a/pub/src/opr.cpp b/pub/src/opr.cpp
index 5001fce346493abe584ebfee9c855ff43d21abbe..f1d7f1d93aae077ece3d02805508c40ee1064a54 100644
--- a/pub/src/opr.cpp
+++ b/pub/src/opr.cpp
@@ -11,6 +11,7 @@
 #include <iostream>
 #include <string>
 #include <vector>
+#include <algorithm>
 #include <boost/format.hpp>
 
 #include <read-plus/ask.hpp>
@@ -60,7 +61,6 @@ void NOperate::Show( const string& subcmd )
 
         // printout by i:
         for ( uint i=0; i<ni; i++) {
-
             outj = "";
             outp = "";
 
@@ -435,7 +435,7 @@ void NIntOld::Opr()
                 fout->yco.unit = fin->yco.unit;
             } else if (mod== 4) {
                 fout->yco.name = "sigma(" + fin->yco.name + ")";
-                fout->yco.unit = "" ;
+                fout->yco.unit = "";
             } else if (mod== 5) {
                 fout->yco.name = fin->xco.name + "_max";
                 fout->yco.unit = fin->xco.unit;
@@ -475,11 +475,11 @@ void NIntOld::Opr()
                 fout->yco.unit = fin->xco.unit;
             } else if (mod==16) {
                 fout->yco.name = "sigma(" + fin->xco.name + ")";
-                fout->yco.unit = "" ;
+                fout->yco.unit = "";
             } else if (mod==17) {
                 fout->yco.name = "rho(" + fin->xco.name +
                     "|" + fin->yco.name + ")";
-                fout->yco.unit = "" ;
+                fout->yco.unit = "";
             } else {
                 throw "invalid mode";
             }
diff --git a/pub/src/plot.cpp b/pub/src/plot.cpp
index c6d23349dcf6702844d3796f3b32e5fd612998f3..de94c737aaa8b1979a90c71f2690d704f56672bc 100644
--- a/pub/src/plot.cpp
+++ b/pub/src/plot.cpp
@@ -393,7 +393,6 @@ int plot_curve_refine( CPlot* plot, POlc fc, uint k, uint j, int cstyle )
                 if ( xc[i+1]<=xc[i] )
                     throw "BUG: new base points not sorted at " +
                         S(i) + ": " + S(xc[i]) + " " + S(xc[i+1]);
-
     }
 
     // divide into segments and plot:
@@ -464,7 +463,6 @@ void NPlot::Plot( class CPlot *plot, bool add, const string& mode )
         // draw new frame:
         plot->clearFrame();
         plot->plotFrame( xCo.str_ps(), yCo.str_ps() );
-
     }
 
     // plot:
diff --git a/pub/src/rssm.cpp b/pub/src/rssm.cpp
index 47e76ea2b0aef1600b2c22a62ab654fe1960ba05..c3885fc3f8d5b9e6471be24726ce17df7a78322b 100644
--- a/pub/src/rssm.cpp
+++ b/pub/src/rssm.cpp
@@ -86,8 +86,7 @@ void CRawfileSpheres::RdRawYam( ifstream& F_in )
     try{ 
         if(!doc.FindValue("Shortpar"))
             throw "DATA BUG: no Shortpar";
-        for(YAML::Iterator it=doc["Shortpar"].begin();
-            it!=doc["Shortpar"].end();++it) {
+        for(auto it=doc["Shortpar"].begin(); it!=doc["Shortpar"].end(); ++it) {
             it.first() >> key;
             it.second() >> val;
             if      ( key=="incremental" ){
@@ -367,7 +366,6 @@ void NRSSM::ReadSpec( int flag )
     if( ! (flag & 8 ) ){
         NOlm::mem_store( olf[6] );
     }
-
 }
 
 //! Read a series of raw data files.
@@ -410,7 +408,8 @@ void NRSSM::ReadSeries( int flag )
         ( RR[nsub-1].measured_until - RR[0].measured_until ) / nsub;
     printf( "mean measuring time %g seconds per file\n", mean_time );
     t = (time_t) (RR[0].measured_until-mean_time);
-    strftime( tstrg, 30, "%F %b %H:%M:%S", localtime( &t ) );
+    struct tm tlocal;
+    strftime( tstrg, 30, "%F %b %H:%M:%S", localtime_r( &t, &tlocal ) );
     printf( "measurement times relative to start time %s\n", tstrg );
     for( isub=0; isub<nsub; ++isub )
         RR[isub].measured_at = RR[isub].measured_until - 
@@ -565,5 +564,4 @@ void NRSSM::ReadSeries( int flag )
     if( 1 ){
         NOlm::mem_store( olf[0] );
     }
-
 }