Fixed error handling if file not found.