latest fixes for flags size, protection against being called during program destructors, warning fixes, allocation flags fixes