Major fix - Incorrect index search and NULL dataframe