few small crash fixes