Improve basic flags handling