fix various lifetime tracking mistakes