Added tests for data serialisation.