Fixed wrong parsing of flag values if oldFlag is null
* prevents illegal statements in insert querys