CORE-5837: A little code cleanup
CORE-5837: Files are no longer added twice
CORE-5837: Corrected variable name to prevent issues