There was an error in referring the debug flags.
Bug fixes were debug flag.
Yeh the debug flag only worked if you set it globally, but I guess you might want to change it per instance as well..
Thanks for the patch!
btw there isn't a memcached variable here.. this should been this instead
Thank you for quick response.