Fixed some crashes in frontend