Fix last char bug