Fix null pointer exception on missing files