Fix class initialization called more than once.