Fixed bugs/crashes