Fix NPE which was occuring when requesting a completed aggregation.
Also, writing a dummy output file in dev mode.