Error checking for main files