Fixed some compilation errors caused by library dependencies and multiple definitions of functions.
Fixed segfaults in trace_reset_buffer (memset was working with more memory then we allocated).
Enabled tracing of events.