Fix retain cycle (issue #1404)