Fix unloading and static init