Fixed bug where flags would not be turned off on second evaluation if they should have been