Fixed missing last char bug