Fix IFF state handling and add proper error message.