Replaced library return values with their C definitions
Added sending of (last) will messages