Fixed a few issues related to quotes and caret position