Fix the expand action. Couple of NPE and the data format was wrong.

Only affects action=expand