Functions and useful stuff for memory leak debugging