Fix several leaks of weakRefs
Fix some memory issues
Static analyzer care and feeding