Fixed issue serialising explicitly named JSON objects.