diff --git a/src/@dseries/align.m b/src/@dseries/align.m
index 37eece439fc21b9e1e45bc22f9a89eebd1da5814..e42891bcdeffa72e73e0beb4a363a91db6b31cb2 100644
--- a/src/@dseries/align.m
+++ b/src/@dseries/align.m
@@ -1,33 +1,17 @@
-function [a,b] = align(a, b) % --*-- Unitary tests --*--
-
-%@info:
-%! @deftypefn {Function File} {[@var{a}, @var{b}] =} align (@var{a}, @var{b})
-%! @anchor{dseries/align}
-%! @sp 1
-%! If dseries objects @var{a} and @var{b} are defined on different time ranges, extend @var{a} and/or
-%! @var{b} with NaNs so that they are defined on the same time range.
-%! @sp 2
-%! @strong{Inputs}
-%! @sp 1
-%! @table @ @var
-%! @item a
-%! Object instantiated by @ref{dseries}.
-%! @item b
-%! Object instantiated by @ref{dseries}.
-%! @end table
-%! @sp 2
-%! @strong{Outputs}
-%! @sp 1
-%! @table @ @var
-%! @item a
-%! Object instantiated by @ref{dseries}.
-%! @item b
-%! Object instantiated by @ref{dseries}.
-%! @end table
-%! @end deftypefn
-%@eod:
+function [o, p] = align(o, p) % --*-- Unitary tests --*--
-% Copyright (C) 2013 Dynare Team
+% If necessay completes dseries object o and p so that they are defined on the same time range
+% (in place modification).
+%
+% INPUTS
+% - o [dseries]
+% - p [dseries]
+%
+% OUTPUTS
+% - o [dseries]
+% - p [dseries]
+
+% Copyright (C) 2013-2015 Dynare Team
%
% This file is part of Dynare.
%
@@ -44,46 +28,9 @@ function [a,b] = align(a, b) % --*-- Unitary tests --*--
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see .
-if ~isequal(frequency(a),frequency(b))
- error(['dseries::align: ''' inputname(1) ''' and ''' inputname(2) ''' dseries objects must have common frequencies!'])
-end
-
-init = min(firstdate(a),firstdate(b));
-last = max(lastdate(a),lastdate(b));
-
-if isempty(intersect(a.dates,b.dates))
- error(['dseries::align: ''' inputname(1) ''' and ''' inputname(2) ''' dseries object must have at least one common date!'])
-end
-
-a_init = init;
-b_init = init;
-a_last = last;
-b_last = last;
-
-if firstdate(b)>init
- n = firstdate(b)-init;
- b.data = [NaN(n, vobs(b)); b.data];
- b_init = init;
-end
-
-if firstdate(a)>init
- n = firstdate(a)-init;
- a.data = [NaN(n, vobs(a)); a.data];
- a_init = init;
-end
-
-if lastdate(b).
+
+if ~isequal(frequency(o),frequency(p))
+ error(['dseries::align: ''' inputname(1) ''' and ''' inputname(2) ''' dseries objects must have common frequencies!'])
+end
+
+init = min(firstdate(o),firstdate(p));
+last = max(lastdate(o),lastdate(p));
+
+if isempty(intersect(o.dates,p.dates))
+ error(['dseries::align: ''' inputname(1) ''' and ''' inputname(2) ''' dseries object must have at least one common date!'])
+end
+
+o_init = init;
+p_init = init;
+o_last = last;
+p_last = last;
+
+if firstdate(p)>init
+ n = firstdate(p)-init;
+ p.data = [NaN(n, vobs(p)); p.data];
+ p_init = init;
+end
+
+if firstdate(o)>init
+ n = firstdate(o)-init;
+ o.data = [NaN(n, vobs(o)); o.data];
+ o_init = init;
+end
+
+if lastdate(p).
+
+p = dseries();
+p.data = o.data;
+p.name = o.name;
+p.tex = o.tex;
+p.dates = o.dates;
+
+%@test:1
+%$ % Define a dates object
+%$ data = rand(10,2);
+%$ o = dseries(data);
+%$ q = dseries(data);
+%$
+%$ % Call the tested routine.
+%$ try
+%$ p = copy(o);
+%$ t(1) = true;
+%$ catch
+%$ t(1) = false;
+%$ end
+%$
+%$ if t(1)
+%$ o.log_();
+%$ t(2) = dassert(p, q);
+%$ end
+%$
+%$ T = all(t);
+%@eof:1
\ No newline at end of file
diff --git a/src/@dseries/exp.m b/src/@dseries/exp.m
index 06ed6a1f03291cb11d51ea5fcd35855c87987cab..d293877be02a1ff8c93025874a210315c11040e4 100644
--- a/src/@dseries/exp.m
+++ b/src/@dseries/exp.m
@@ -1,33 +1,14 @@
-function ts = exp(ts)
-% Apply the exponential function to a Dynare time series object.
+function o = exp(o) % --*-- Unitary tests --*--
-%@info:
-%! @deftypefn {Function File} {@var{ts} =} log(@var{ts})
-%! @anchor{exp}
-%! Apply the exponential function to a Dynare time series object.
-%!
-%! @strong{Inputs}
-%! @table @var
-%! @item ts
-%! Dynare time series object, instantiated by @ref{dseries}
-%! @end table
-%!
-%! @strong{Outputs}
-%! @table @var
-%! @item ts
-%! Dynare time series object with transformed data field.
-%! @end table
-%!
-%! @strong{This function is called by:}
-%! None.
-%!
-%! @strong{This function calls:}
-%! None.
-%!
-%! @end deftypefn
-%@eod:
+% Apply the exponential to all the variables in a dseries object (without in place modification).
+%
+% INPUTS
+% - o [dseries]
+%
+% OUTPUTS
+% - o [dseries]
-% Copyright (C) 2011-2013 Dynare Team
+% Copyright (C) 2011-2015 Dynare Team
%
% This file is part of Dynare.
%
@@ -44,9 +25,52 @@ function ts = exp(ts)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see .
-ts.data = exp(ts.data);
+o = copy(o);
+o.exp_();
+
+%@test:1
+%$ % Define a dates object
+%$ data = zeros(10,2);
+%$ o = dseries(data);
+%$ q = dseries(data);
+%$
+%$ % Call the tested routine.
+%$ try
+%$ p = o.exp();
+%$ t(1) = true;
+%$ catch
+%$ t(1) = false;
+%$ end
+%$
+%$ if t(1)
+%$ t(2) = dassert(o, q);
+%$ t(3) = dassert(p.data, ones(10, 2));
+%$ end
+%$
+%$ T = all(t);
+%@eof:1
-for i=1:vobs(ts)
- ts.name(i) = {['exp(' ts.name{i} ')']};
- ts.tex(i) = {['\exp(' ts.tex{i} ')']};
-end
\ No newline at end of file
+%@test:2
+%$ % Define a dates object
+%$ data = zeros(10,2);
+%$ o = dseries(data);
+%$ q = dseries(data);
+%$
+%$ % Call the tested routine.
+%$ try
+%$ p = o.exp();
+%$ t(1) = true;
+%$ catch
+%$ t(1) = false;
+%$ end
+%$
+%$ if t(1)
+%$ t(2) = dassert(length(p.name), 2);
+%$ t(3) = dassert(p.name{1},'exp(Variable_1)');
+%$ t(4) = dassert(p.name{2},'exp(Variable_2)');
+%$ t(5) = dassert(o.name{1},'Variable_1');
+%$ t(6) = dassert(o.name{2},'Variable_2');
+%$ end
+%$
+%$ T = all(t);
+%@eof:2
\ No newline at end of file
diff --git a/src/@dseries/exp_.m b/src/@dseries/exp_.m
new file mode 100644
index 0000000000000000000000000000000000000000..6a6fdd35540ae443279c34ef3ef947a1280a304b
--- /dev/null
+++ b/src/@dseries/exp_.m
@@ -0,0 +1,85 @@
+function o = exp_(o) % --*-- Unitary tests --*--
+
+% Apply the exponential to all the variables in a dseries object (in place modification).
+%
+% INPUTS
+% - o [dseries]
+%
+% OUTPUTS
+% - o [dseries]
+
+% Copyright (C) 2015 Dynare Team
+%
+% This file is part of Dynare.
+%
+% Dynare is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% Dynare is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with Dynare. If not, see .
+
+o.data = exp(o.data);
+
+for i=1:vobs(o)
+ o.name(i) = {['exp(' o.name{i} ')']};
+ o.tex(i) = {['\exp(' o.tex{i} ')']};
+end
+
+%@test:1
+%$ % Define a dates object
+%$ data = zeros(10,2);
+%$ o = dseries(data);
+%$ q = o;
+%$ r = copy(o);
+%$
+%$ % Call the tested routine.
+%$ try
+%$ o.exp_();
+%$ t(1) = true;
+%$ catch
+%$ t(1) = false;
+%$ end
+%$
+%$ if t(1)
+%$ t(2) = dassert(o.data, ones(10,2));
+%$ t(3) = dassert(q.data, ones(10,2));
+%$ t(4) = dassert(r.data, zeros(10, 2));
+%$ end
+%$
+%$ T = all(t);
+%@eof:1
+
+%@test:2
+%$ % Define a dates object
+%$ data = zeros(10,2);
+%$ o = dseries(data);
+%$ q = o;
+%$ r = copy(o);
+%$
+%$ % Call the tested routine.
+%$ try
+%$ o.exp_();
+%$ t(1) = true;
+%$ catch
+%$ t(1) = false;
+%$ end
+%$
+%$ if t(1)
+%$ t(2) = dassert(length(o.name), 2);
+%$ t(3) = dassert(o.name{1},'exp(Variable_1)');
+%$ t(4) = dassert(o.name{2},'exp(Variable_2)');
+%$ t(5) = dassert(q.name{1},'exp(Variable_1)');
+%$ t(6) = dassert(q.name{2},'exp(Variable_2)');
+%$ t(7) = dassert(r.name{1},'Variable_1');
+%$ t(8) = dassert(r.name{2},'Variable_2');
+%$ end
+%$
+%$ T = all(t);
+%@eof:2
\ No newline at end of file
diff --git a/src/@dseries/log.m b/src/@dseries/log.m
index 2ff8e6488572bc1bf7497ca771f996beb34a4962..da357b3a7c200b78b805917c0b4f6656c55e365b 100644
--- a/src/@dseries/log.m
+++ b/src/@dseries/log.m
@@ -1,32 +1,14 @@
-function ts = log(ts)
+function o = log(o) % --*-- Unitary tests --*--
-%@info:
-%! @deftypefn {Function File} {@var{ts} =} log(@var{ts})
-%! @anchor{log}
-%! Apply the logarithm function to a Dynare time series object.
-%!
-%! @strong{Inputs}
-%! @table @var
-%! @item ts
-%! Dynare time series object, instantiated by @ref{dseries}
-%! @end table
-%!
-%! @strong{Outputs}
-%! @table @var
-%! @item ts
-%! Dynare time series object with transformed data field.
-%! @end table
-%!
-%! @strong{This function is called by:}
-%! None.
-%!
-%! @strong{This function calls:}
-%! None.
-%!
-%! @end deftypefn
-%@eod:
+% Apply the logarithm to all the variables in a dseries object (without in place modification).
+%
+% INPUTS
+% - o [dseries]
+%
+% OUTPUTS
+% - o [dseries]
-% Copyright (C) 2011-2013 Dynare Team
+% Copyright (C) 2011-2015 Dynare Team
%
% This file is part of Dynare.
%
@@ -43,13 +25,56 @@ function ts = log(ts)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see .
-if any(ts.data.
+
+if any(o.data1 && isequal(S(2).type,'()') && isempty(S(2).subs)
S = shiftS(S,1);