Fixed errors on recent merge. Duplicate code was found in files with different filenames.