Added more file handling support