Fixed bug in JSON serialization.