Fixed NPE in plot generator