Fix possible recursion in sml/apply-theme.