Fixed log_id() memory corruption
Started to implement real resource sharing