Aaaah! Terrible file overwrite bug