Fixed major bugs regarding file merges.