Added more checks around setup (file creation).