Use weak references to self to avoid retain cycles in blocks

Fixes: #2