Bug fixes towards redis support