fix complex as_xxx bug