Updated C++# to fix two bugswith incorrect code and memory. Updated the tests to use the newly exposed wrapped C++ API.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>