Fixed a bug loading the flag and cleaned up files