Properly deallocation of memory.
Merge pull request #170 from murrekatt/develop

Properly deallocation of memory
Fix gtest for "make distcheck" (tarball build).
Reinstate gtest internal dependency build.