fixed a flaw in debug-logging, and home-dir judge