Properly serialize enums and prevent duplicate entries in file list