Added flags to irop determining the behaviour, this saves some switches.