Fixed initialisation issues with ZTS