Fix redundant jsonification of workload. Add tests.