Fixed the initialization order to support better extending.