Fixed some bugs with JsonSerializable.