Bugfixes towards redis support