Fixed resource leak and dotfile ignroing