Getting menu links: correct chain of API functions
Since you're using menu_link_get_preferred() I'm guessing Drupal 7 here...

Theme functions have changed, and parameters now need to be named in an associative array passed to the theme function. So per the theme_menu_link() docs:

$html .= theme('menu_link', $menu_link);


becomes

$html .= theme('menu_link', array('element' =&gt; $menu_link));