Fix #498, the object state was not initialized