Fixed crashes and bugs

mhm