Did not manage to fix the crash. Still needs work.