Fix two bugs found in manual win32 testing.