Big leap towards correct file handling