fixes to joining of dataframes etc