much improved str::sanitize, other minor fixes