Fixed bug in serialisation of data when there is no data (!)