Added error messages for missing folders, and removed segfaults caused by missing folders