Fixed File Exists and Dir Exists errors