Updated to provide warnings on empty and invalid files