Added unit test for ExpressionTree calculation. Fixed a bug when the
output stream is null.