The above proc is what I use to handle most, if not all, changes to overlays. It works just fine after you login, performing all the correct actions without any problems. However, when you logout and have overlays(or something equipped), then log back in, the overlays get stuck on the player, as a part of the icon evidently. Hair, however, is unaffected. It call still be changed and removed as normal.
Also, if you don't have any items equipped, overlays are removed as normal upon logging in, and hair is added normally. Yet if you do have something equipped, it adds the overlays and gets stuck on the icon.
I find this odd. I checked both my login and logout, as well as mob/New and Del, and obj/New and Del. There is nothing in any of the aforementioned procs that alters anything on any items in the players contents, nor anything that alters the players overlays.
What could be the problem? This never gave me any problems until recently, I'd say probably version 420 or so.
Step by Step:
2. Equip something, maybe get a haircut
4. Login again
--messed up icon/overlays--
--overlays/icon normal, hair (if any) added--