Fixed error caused by the "sub" variable being serialized as an array instead of an object.