fixes for merging from separate files into one final version