Fixed bugs in tiplugin and updated the unit test. Fixed incorrect docs in the environ lib.