Fix flags problem