Added presence check timeout, debug mode toggle.