Fix static initialization and destruction error.