fix arguments to isinstance() in env lookup