bug fixes now that I understand the win32 api better