diff --git a/CMakeLists.txt b/CMakeLists.txt
index 666b3a570c79897463383811a32a2ea6cc68eaff..4017171d8c5b3a28c8077a27e2899948be5d80ff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,7 +9,7 @@ string (REGEX REPLACE "\\." "" PACKAGE_VERSION ${PACKAGE_VERSION})
 message (PACKAGE_VERSION=${PACKAGE_VERSION})
 
 if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
-    set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
+  set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
         "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
         FORCE
 	)
@@ -41,14 +41,15 @@ set (CMAKE_CXX_STANDARD 11)
 set (CMAKE_CXX_STANDARD_REQUIRED ON)
 set (CMAKE_CXX_EXTENSIONS OFF)
 
-add_definitions (-DIPPL_LINUX -DIPPL_STRINGSTREAM)
-add_definitions (-DIPPL_MPI -DMPICH_SKIP_MPICXX -DIPPL_DONT_POOL)
+add_definitions (-DIPPL_MPI)
+add_definitions (-DIPPL_DONT_POOL)
 add_definitions (-DIPPL_USE_XDIV_RNG)
 add_definitions (-DIPPL_USE_PARTIAL_SPECIALIZATION)
-add_definitions (-Drestrict=__restrict__ -DNOCTAssert)
+add_definitions (-DNOCTAssert)
 
 add_compile_options (-Wall)
 add_compile_options (-funroll-loops -fstrict-aliasing)
+
 option (USE_STATIC_LIBRARIES "Link with static libraries if available" ON)
 if (NOT ${USE_STATIC_LIBRARIES})
     add_compile_options (-fPIE -fPIC)
@@ -73,7 +74,6 @@ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
     add_compile_options (-ftemplate-depth=1024)
     # Allow overloaded virtual functions (instances to be fixed in OPAL)
     #add_compile_options (-Wno-overloaded-virtual)
-    add_definitions(-DIPPL_RESTRICT_BUG)
     if (ENABLE_OpenMP)
 	    add_compile_options (-fopenmp)
     endif ()
@@ -280,10 +280,11 @@ install (
     DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}"
     RENAME ${PROJECT_NAME}Config.cmake
     )
-
+  
 # vi: set et ts=4 sw=4 sts=4:
+  
 # Local Variables:
-# mode:cmake
+# mode: cmake
 # cmake-tab-width: 4
-# indent-tabs-mode:nil
+# indent-tabs-mode: nil
 # End:
diff --git a/cmake/OPALConfig.cmake.in b/cmake/OPALConfig.cmake.in
index 9a35206afdc79d26afd3e0a0035ac4892ea03e05..de6b1c9110a802b0a76a57876eba24eefa924642 100644
--- a/cmake/OPALConfig.cmake.in
+++ b/cmake/OPALConfig.cmake.in
@@ -1,11 +1,9 @@
-SET(${PROJECT_NAME}_CMAKE_CXX_FLAGS "${${PROJECT_NAME}_CXX_FLAGS}")
-SET(${PROJECT_NAME}_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
-SET(${PROJECT_NAME}_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/lib")
-SET(${PROJECT_NAME}_LIBRARY "${CMAKE_INSTALL_PREFIX}/lib/libOPAL.a")
+set (${PROJECT_NAME}_CMAKE_CXX_FLAGS "${${PROJECT_NAME}_CXX_FLAGS}")
+set (${PROJECT_NAME}_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
+set (${PROJECT_NAME}_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+set (${PROJECT_NAME}_LIBRARY "${CMAKE_INSTALL_PREFIX}/lib/libOPAL.a")
 
-SET(IPPL_CMAKE_CXX_FLAGS "${IPPL_CMAKE_CXX_FLAGS}")
-
-SET(${PROJECT_NAME}_LIBRARIES
+set (${PROJECT_NAME}_LIBRARIES
     ${GSL_LIBRARY}
     ${GSL_CBLAS_LIBRARY}
     ${H5Hut_LIBRARY}
@@ -20,7 +18,7 @@ SET(${PROJECT_NAME}_LIBRARIES
     ${CMAKE_DL_LIBS}
 )
 
-SET(${PROJECT_NAME}_INCLUDE_DIRS
+set (${PROJECT_NAME}_INCLUDE_DIRS
     ${OPAL_SRC_DIR}
     ${CLASSIC_SRC_DIR}
     ${IPPL_INCLUDE_DIR}
diff --git a/ippl/CMakeLists.txt b/ippl/CMakeLists.txt
index 5323dba87dab74c8c3eb866a17b77992823c26db..e4d530dbbf3afd234d349f0f0573bf84f8b80421 100644
--- a/ippl/CMakeLists.txt
+++ b/ippl/CMakeLists.txt
@@ -7,9 +7,7 @@ set (IPPL_VERSION_NAME "V${IPPL_VERSION_MAJOR}.${IPPL_VERSION_MINOR}")
 set (IPPL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 
 if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
-  add_definitions (-DNOPAssert)
-else ()
-  add_definitions (-DIPPL_DEBUG)
+    add_definitions (-DNOPAssert)
 endif ()
 
 set (IPPL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src" PARENT_SCOPE)
@@ -20,15 +18,23 @@ add_subdirectory (src)
 
 option (ENABLE_IPPLTESTS "IPPL Tests" OFF)
 if (ENABLE_IPPLTESTS)
-  add_subdirectory (test)
+    add_subdirectory (test)
 endif ()
 
 configure_file (${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in
-  ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config_install.cmake )
+    ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config_install.cmake )
 
 install (
-  FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config_install.cmake
-  DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}"
-  RENAME ${PROJECT_NAME}Config.cmake
-  )
+    FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config_install.cmake
+    DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}"
+    RENAME ${PROJECT_NAME}Config.cmake
+    )
+
+# vi: set et ts=4 sw=4 sts=4:
+
+# Local Variables:
+# mode: cmake
+# cmake-tab-width: 4
+# indent-tabs-mode: nil
+# End:
 
diff --git a/ippl/src/Field/BrickExpression.hpp b/ippl/src/Field/BrickExpression.hpp
index 7269b2b9ce7d8aff562d3fb27b26d013fe9ae260..7c8a7e0d13b3f160214b59d00107ab372924260c 100644
--- a/ippl/src/Field/BrickExpression.hpp
+++ b/ippl/src/Field/BrickExpression.hpp
@@ -35,7 +35,7 @@ class BrickExpLoop
 {
 public: 
   static inline void
-  apply(LHS& restrict Lhs, RHS& restrict Rhs, OP Op)
+  apply(LHS& __restrict__ Lhs, RHS& __restrict__ Rhs, OP Op)
     {
       int n0 = Lhs.size(0);
       int n1 = Lhs.size(1);
@@ -74,7 +74,7 @@ template<class LHS, class RHS, class OP>
 class BrickExpLoop<LHS,RHS,OP,1U>
 {
 public:
-  static inline void apply(LHS& restrict Lhs, RHS& restrict Rhs, OP Op)
+  static inline void apply(LHS& __restrict__ Lhs, RHS& __restrict__ Rhs, OP Op)
     {
       int n0 = Lhs.size(0);
       for (int i0=0; i0<n0; ++i0) {
@@ -90,7 +90,7 @@ class BrickExpLoop<LHS,RHS,OP,2U>
 {
 public:
   static inline void
-  apply(LHS& restrict Lhs, RHS& restrict Rhs, OP Op)
+  apply(LHS& __restrict__ Lhs, RHS& __restrict__ Rhs, OP Op)
     {
       int n0 = Lhs.size(0);
       int n1 = Lhs.size(1);
@@ -109,7 +109,7 @@ class BrickExpLoop<LHS,RHS,OP,3U>
 {
 public:
   static inline void
-  apply(LHS& restrict Lhs, RHS& restrict Rhs, OP Op)
+  apply(LHS& __restrict__ Lhs, RHS& __restrict__ Rhs, OP Op)
     {
       int n0 = Lhs.size(0);
       int n1 = Lhs.size(1);
diff --git a/ippl/src/Field/BrickIterator.h b/ippl/src/Field/BrickIterator.h
index d8a4bd62340f1e33f1cc8884ab53003b9ea228a1..05f7597f2b3299db5956eb26345a44b70f4e43fd 100644
--- a/ippl/src/Field/BrickIterator.h
+++ b/ippl/src/Field/BrickIterator.h
@@ -188,7 +188,7 @@ public:
 
 protected: 
   void op_pp();
-  T* restrict Current;		// The current datum.
+  T* __restrict__ Current;		// The current datum.
   vec<int,Dim> Strides;		// The strides in the data.
   bool Whole;			// True if iterating over whole brick
 };
diff --git a/ippl/src/Field/CompressedBrickIterator.hpp b/ippl/src/Field/CompressedBrickIterator.hpp
index 1de82c5dceae0da7cce3b6ce365845cadc1e20f5..cb697cd6a798518776eb9b3b1f4dc99fcd04d606 100644
--- a/ippl/src/Field/CompressedBrickIterator.hpp
+++ b/ippl/src/Field/CompressedBrickIterator.hpp
@@ -289,32 +289,6 @@ permute(const CompressedBrickIterator<T,D1>& iter,
 
   unsigned int d1, d2;
 
-#ifdef IPPL_DEBUG
-  // Do a sanity check.
-  // Make sure that any indexes in current that don't appear
-  // in perm have length of 1.
-  // It is ok to have indexes in perm that don't appear in current.
-  // They just get zero stride.
-
-  // Check each Index in current.
-  for (d1=0; d1<D1; ++d1)
-    {
-      // Compare with every Index in perm.
-      for (d2=0; d2<D2; ++d2)
-	// If they match, check the next one.
-	if ( perm[d2].sameBase( current[d1] ) )
-	  {
-	    goto FoundIt;
-	  }
-      // Didn't find it.
-      // Make sure the length is 1.
-      PAssert_EQ( current[d1].length(), 1 );
-    FoundIt:
-      ;
-    }
-
-#endif
-
   // This is the iterator we'll be building.
   CompressedBrickIterator<T,D2> permute(iter.GetCompressedData());
   if ( iter.IsCompressed() )
diff --git a/optimizer/CMakeLists.txt b/optimizer/CMakeLists.txt
index d94c1ac54c57df319b75f8fd439d880eccc67772..9639de25eead27434eca344b936055811be40989 100644
--- a/optimizer/CMakeLists.txt
+++ b/optimizer/CMakeLists.txt
@@ -34,7 +34,6 @@ add_subdirectory (extlib)
 #-----------------------------------------------------------------------------
 # Build liboptp for linking to OPAL
 #
-add_compile_options (${IPPL_CMAKE_CXX_FLAGS})
 
 include_directories (${CMAKE_CURRENT_SOURCE_DIR})
 add_library (optp ${OPTP_SRCS} ${PILOT_OPAL_SRCS})
@@ -72,3 +71,11 @@ if (ENABLE_DOXYDOC)
             )
     endif ()
 endif ()
+
+# vi: set et ts=4 sw=4 sts=4:
+  
+# Local Variables:
+# mode: cmake
+# cmake-tab-width: 4
+# indent-tabs-mode: nil
+# End:
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 458d24f430055a9449bbe1c705c45974f3529012..a190470f1221ff95a9c4173c93140720b7685b0d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,13 +1,9 @@
 set (DKS_VERSION_OPAL \"${DKS_VERSION}\")
 
-add_definitions (
-    "${IPPL_CMAKE_CXX_FLAGS} -DPARALLEL_IO ${CMAKE_CXX_FLAGS}"
-    )
+add_definitions (-DPARALLEL_IO)
 
 if (ENABLE_SAAMG_SOLVER)
-    set (CMAKE_CXX_FLAGS
-        "-DHAVE_SAAMG_SOLVER ${CMAKE_CXX_FLAGS}"
-        )
+    add_definitions (-DHAVE_SAAMG_SOLVER)
     set (SAAMG_SOLVER_LIBS
         ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES}
         ${Fortran_LIBS}
@@ -22,21 +18,18 @@ if (ENABLE_AMR)
         ${Fortran_LIBS}
         ${AMREX_EXTRA_Fortran_LINK_LINE}
         ${AMREX_LIBRARIES}
-        
-    )
+        )
 else (ENABLE_AMR)
     set(AMR_LIBS "")
-endif (ENABLE_AMR)
+endif ()
 
 if (ENABLE_AMR AND ENABLE_AMR_MG_SOLVER)
-    set (CMAKE_CXX_FLAGS
-        "-DHAVE_AMR_MG_SOLVER ${CMAKE_CXX_FLAGS}"
-    )
+    add_definitions (-DHAVE_AMR_MG_SOLVER)
     set (AMR_MG_SOLVER_LIBS
         ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
-else (ENABLE_AMR AND ENABLE_AMR_MG_SOLVER)
+else ()
     set (AMR_MG_SOLVER_LIBS "")
-endif(ENABLE_AMR AND ENABLE_AMR_MG_SOLVER)
+endif ()
 
 configure_file(config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/OPALconfig.h)
 configure_file(revision.h.in ${CMAKE_CURRENT_SOURCE_DIR}/OPALrevision.h)
@@ -73,8 +66,8 @@ macro (ADD_OPAL_HEADERS )
     endif ()
 endmacro ()
 
-ADD_OPAL_SOURCES(opal.cpp)
-ADD_OPAL_SOURCES(changes.cpp)
+add_opal_sources (opal.cpp)
+add_opal_sources (changes.cpp)
 
 add_subdirectory (AbstractObjects)
 add_subdirectory (Algebra)
@@ -106,7 +99,7 @@ if (ENABLE_AMR)
     add_subdirectory (Amr)
 endif ()
 
-include_directories ( BEFORE
+include_directories (BEFORE
     ${OPAL_SRC_DIR}
     ${CLASSIC_SRC_DIR}
     ${IPPL_INCLUDE_DIR}
@@ -185,12 +178,9 @@ set (HDRS
 install (FILES ${HDRS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/src")
 
 # vi: set et ts=4 sw=4 sts=4:
+
 # Local Variables:
 # mode:cmake
 # cmake-tab-width: 4
 # indent-tabs-mode:nil
 # End:
-
-#Turn on gcov
-#set(CMAKE_CXX_FLAGS "-g -O0 -Wall -fprofile-arcs -ftest-coverage")
-#set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)