Fix a lot of reference counting bugs introduced by stupid copy/pasting
3 files changed