Fixed bug with missing last character