fix weak reference warnings.