Fix standalone build to work with envs with self