improve and fix string routines
fix strlen