Changed two functions of the C++ wrapper to return values when the underlying C calls do.

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