Added root preferences and fixed a memory leak

Root preferences are wip