Tweaks for mac. Added support for setting test env.