fixed serialiser getState for primitives