Fixed common crashes