Fixed a bug affecting the measureText() method