Bugfix to the code that writes to redis.