Fixed bugs on interpocess comunication, added stats