Fixed bugs causing Brackets to crash. Preferences are not saved when Session ends though