Fast utf-8 string length implementation + small fixes.