Ensuring that only files are returned from any iterator