Fixed some JSON serialization bugs