Fix sml problems