several crashes fixed