Fixed error causing cursor to position wrong.