Fix reference issue
Less debug output
Start with thread-safe stuff
Work on multithreading