Bug fix: variables need to be serialized in a well-defined order.