some fixes to the callback system + memory leak patched