Fixed filepath regex and other bugs