Fixed a few more NPE issues related to existence of files