Fix an off-the-end string pointer bug (showed up only in some Win32 builds).
Win32 build script fixes (to allow portfolio builds).