Fixed up some file handling.