Fix string length bug