fixed up hints for WM
several bug fixes, mainly related to memory leaks