Fixing JSON/XML bug