kscope tests and serialization fixes