sml stuff and other fixup.