Fixing caret positioning in IE and Firefox