Weakref callback fixes