Bugfix: Empty dir was treated as a file. Fixed

An aditional conditional was added to make sure file_exists() brings only real files