I have really long urls. When a page doesn't have a title, that really long url is output. How can I cut the title to N characters at most?

Alkaline regexp has a method called LEFT . To cut all titles to N characters in the search results simply add |LEFTN to the $title variable in the <!--SET MAP ... --> section. For example:
<!--SET MAP--$recent <a 
  href="$url|URLENCODE" target="_new">$title|LEFT128</a>
-->