Fix signedness, handle get_diagnostics_record return code