recode milex_next, fix some errors in compile time