fix tests and command serialization