Fix redis and optimize debugging