Fix CLEAR_IF_FIRST handling of messages.tdb