Fix for weak references variables