Fixed str -> bytes conversion