fix an internal error for nested expr_expand
add tests for nested expr_expand