fix logical error and missing var
drop pypy for now