Crash fixes