Fix CMake build for Windows
Fix crash in GetCurrentTab