Some changes to help with compilation on win32
Now saves configuration about master key