fix of putenv warning under safe mode, issue #646
fix of already defined constant notice, issue #653
Merge pull request #667 from mariroz/dev

fix of putenv warning under safe mode, issue #646