Tweaked the Session-less environment code in Factory to work on Linux and with mixed-line-terminator files