fixed some problems with stale pointers in conversion