SetFlags() and GetFlags()
SetFlags() returns flags in the format of int.32. This format is not supported as input for GetFlags(). On the ocassion, that you have to check an array, that has been altered by SetFlags(), with GetFlags(), a Error is returned.
GetMaxFlags() is also not able to handle this format int.32. Maybe all three functions should support a format suitable for all three.