Fix crash on exit
Fix crash on open feature dataset