Fix class initialization yielding and promise exceptions.