To be correctly nested, I believe the UL should be there for wp_list_categories and wp_get_archives. See "HERE".
if (function_exists($function)) {
echo "<div class='nice_navigation nice_navigation_look_$look'>";
#echo "<br>function: $function";
#echo "<br>arguments: $arguments";
// wp_list_pages
//HERE if ($function == "wp_list_pages") {
echo "<ul>";
//HERE }
call_user_func($function, $arguments);
//HERE if ($function == "wp_list_pages") {
echo "</ul>";
//HERE }
echo "</div>";