Fixed some bugs from Redis version