Fixing embedded quotes, added tests, fixes #5