fix serialisation of keywords