Some fixes for best work with files