Ahhh.. thanks for pointing that out. The logout logic looks to see if you're trying to let the user logout to a 'Registered' page and, if so, will redirect them to the home page instead of back to the Login module.
The error occurs if you're on a page that doesn't have an Itemid. If you want to fix that issue the correct way, you can edit the helper.php file. Around line 121, you'll see:
if ($itemId == "")
$itemId = JFactory::getApplication()->input->getInt('Itemid', '');
$db = JFactory::getDBO();
$query = "SELECT * FROM #__menu WHERE id=" . $db->quote($itemId);
$db->setQuery($query);
$menuItem = $db->loadObject();
if ($menuItem && $menuItem->access != "1")
{
$default = JFactory::getApplication()->getMenu()->getDefault();
$url = JRoute::_($default->link . '&Itemid=' . $default->id, false);
}Update that with an extra check before the query, like:
if ($itemId == "")
$itemId = JFactory::getApplication()->input->getInt('Itemid', '');
if ($itemId != "")
{
$db = JFactory::getDBO();
$query = "SELECT * FROM #__menu WHERE id=" . $db->quote($itemId);
$db->setQuery($query);
$menuItem = $db->loadObject();
if ($menuItem && $menuItem->access != "1")
{
$default = JFactory::getApplication()->getMenu()->getDefault();
$url = JRoute::_($default->link . '&Itemid=' . $default->id, false);
}
}Thanks for pointing that out. Another area where MySQL is a bit more lenient... for better or worse

Alex