Fixed the bug that crashed the program under root
Removed some debugging prints