Fix the way of returning a value from C