Fix one bug from last commit.

Still something wrong with refcounting in debug mode at least.