improved typevar checking / creating nilable vars