Fixed Memcached implementation

Thanks to @TimWolla