fix sml encoding