Init some variables, needed by gradient