Fixed bug with string slicing