Fix bug in getFile() with empty files and add /dev/random