Rename + Code fixing

Ported to WinASM and fixed a gdi leak.