Write out simple files before ones that can break, and add . to prefix