Fix bug in message ID range check macro