Some improvements to weak event listeners