Fix string length and implementation