Changes to support more file handling options