Fixed new flag setting bug

Was due to wrong function calls