Fixing Dir bug with newer PHP versions where the files in the top level of a directory are just ignored