Some fixes related to file access