WinRT fixes for state saving