Fix computation of index variables
Modified split_filename to return absolute directory