Added namespace to class + fixed memory allocation for buffer.