Add error checks on MT mode value.
Fix mistakenly swallowed exception.
Fix compilation error (typo).
Fix crash in env destructor.
Add symbolic names for MT modes.
Missing parameter specification for *FunctionExists script functions.
Small refactor in BufferPool.
Merge branch 'MT' of upstream into mt-filter-fix
Resize: remove Env pointer from class storage + pre-cast env pointer to env2 before using.