several crashes fixed - closes #154, closes #184