Fix from Tom.Lackemann@falconstor.com to correctly set the flags based