Fix for serializing user objects to Redis cache.