Handle toggles properly. Fix bug when path is either not specified or empty.