Fixed bug in which update_wrapper messed up the weak ref logic.

I still don't understand _why_ this was happening, so I left a note in the code.