Fixing a problem with incref handling