Merge "TIF: Fix crash on setMainSession" into lmp-dev