Fixed conditional on NativePtr.isValid.