diff --git a/src/libs/core/score/tbeamobject.cpp b/src/libs/core/score/tbeamobject.cpp
index ed736d46d68588f04f5396b37bc6b9d9dbd7b4af..e85fec4e811a8a27b8c13e62b724c569b4c53b23 100644
--- a/src/libs/core/score/tbeamobject.cpp
+++ b/src/libs/core/score/tbeamobject.cpp
@@ -67,6 +67,7 @@ TbeamObject::~TbeamObject()
   qDebug() << "     [BEAM] deleted of id" << first()->index();
   for (TnotePair* note : m_notes) {
     note->note()->rtm.setBeam(Trhythm::e_noBeam); // restore beams
+    note->setBeam(nullptr);
   }
 }
 
@@ -114,7 +115,7 @@ void TbeamObject::prepareBeam() {
   bool stemsUpPossible = true;
   qreal hiNote = 99.0, loNote = 0.0;
   for (TnotePair* np : m_notes) {
-    stemDirStrength += np->item()->notePosY() - 18;
+    stemDirStrength += np->item()->notePosY() - (m_measure->staff()->upperLine() + 4.0);
     if (np->item()->notePosY() < MIN_STEM_HEIGHT)
       stemsUpPossible = false;
     hiNote = qMin(hiNote, np->item()->notePosY());
@@ -137,10 +138,9 @@ void TbeamObject::prepareBeam() {
 
 
 /**
- * Poligons are painted, single for 8ths and possible a few for 16ths.
- * Paiter canvas orientation depends on are stems up or down,
- * for stems-up, top beam is 8ths and bottom are 16ths,
- * for stems-down the opposite.
+ * Polygons are painted, single for 8ths and possible a few for 16ths.
+ * Painter canvas orientation depends on stems direction (up or down),
+ * for stems-up, top beam is 8ths and bottom are 16ths in contrary to stems-down
  */
 void TbeamObject::paint(QPainter* painter) {
   if (count() > 1) {
diff --git a/src/libs/core/score/tmeasureobject.cpp b/src/libs/core/score/tmeasureobject.cpp
index 521dd6f9ef145031c5152a938434afa2ca65565c..0de538f737b38395c97484dbc86d69780766ba8e 100644
--- a/src/libs/core/score/tmeasureobject.cpp
+++ b/src/libs/core/score/tmeasureobject.cpp
@@ -25,7 +25,6 @@
 #include "music/tmeter.h"
 #include "music/tnote.h"
 
-#include <QtQml/qqmlengine.h>
 #include <QtQml/qqmlcomponent.h>
 #include <QtCore/qdebug.h>
 
@@ -46,6 +45,11 @@ TmeasureObject::TmeasureObject(int nr, TscoreObject* parent) :
 
 TmeasureObject::~TmeasureObject()
 {
+  // delete beams
+  for (TnotePair* np : m_notes) {
+    if (np->beam() && np == np->beam()->last())
+      delete np->beam();
+  }
 //   qDebug() << debug() << "is going delete";
 }
 
@@ -89,6 +93,7 @@ void TmeasureObject::appendNewNotes(int segmentId, int count) {
         ns->beam()->prepareBeam();
         break;
       }
+      ++firstInGrId;
     }
   }
   refresh();
@@ -173,10 +178,8 @@ void TmeasureObject::checkBarLine() {
   if (m_free == 0 && m_score->meter()->meter() != Tmeter::NoMeter) {
     auto lastNote = last()->item();
     if (!m_barLine) {
-      QQmlEngine engine;
-      QQmlComponent comp(&engine, this);
-      comp.setData("import QtQuick 2.7; Rectangle { width: 0.3; height: 8 }", QUrl());
-      m_barLine = qobject_cast<QQuickItem*>(comp.create());
+      m_staff->score()->component()->setData("import QtQuick 2.7; Rectangle { width: 0.3; height: 8 }", QUrl());
+      m_barLine = qobject_cast<QQuickItem*>(m_staff->score()->component()->create());
       m_barLine->setParentItem(lastNote);
       m_barLine->setProperty("color", lastNote->color());
       m_barLine->setY(m_staff->upperLine());
diff --git a/src/libs/core/score/tmeasureobject.h b/src/libs/core/score/tmeasureobject.h
index 9d9675f160c8bcebdd6ce0e6192bfe053e1ce36c..0ced27d89a4f7446fe048924180036a06e403ff2 100644
--- a/src/libs/core/score/tmeasureobject.h
+++ b/src/libs/core/score/tmeasureobject.h
@@ -128,8 +128,8 @@ protected:
       /**
        * Checks notes rhythms of group @p segmentId belongs to
        * for 8ths and 16ths and crates beams (@p TbeamObject) if they occurs
-       * It can be called before @p TnoteObject will be created
-       * When beam was set or note was added to it it returns number of that group
+       * It can be called before @p TnoteObject creation.
+       * When beam was set or note was added to it, it returns number of that group
        * or -1 if no beams were added
        */
   int beamGroup(int segmentId);
diff --git a/src/libs/core/score/tnoteobject.cpp b/src/libs/core/score/tnoteobject.cpp
index d3a67c096672d35b1f41b794df1c32b0a0d317da..8abe39482aa5c954d84a075e68edde0b41a61feb 100644
--- a/src/libs/core/score/tnoteobject.cpp
+++ b/src/libs/core/score/tnoteobject.cpp
@@ -24,7 +24,6 @@
 #include "tnotepair.h"
 #include "music/tnote.h"
 
-#include <QtQml/qqmlengine.h>
 #include <QtGui/qguiapplication.h>
 #include <QtGui/qpalette.h>
 #include <QtCore/qtimer.h>
@@ -84,8 +83,6 @@ TnoteObject::TnoteObject(TstaffObject* staffObj, TnotePair* wrapper) :
 {
   setParent(m_staff->score()); // to avoid deleting with parent staff
   m_note = new Tnote();
-  QQmlEngine engine;
-  QQmlComponent comp(&engine, this);
 
   m_staff->score()->component()->setData("import QtQuick 2.7; Rectangle {}", QUrl());
   m_stem = qobject_cast<QQuickItem*>(m_staff->score()->component()->create());
@@ -130,6 +127,8 @@ TnoteObject::TnoteObject(TstaffObject* staffObj, TnotePair* wrapper) :
 TnoteObject::~TnoteObject() {
 //   qDebug() << debug() << "is going deleted";
   delete m_note;
+  if (m_name)
+    delete m_name;
 }
 
 
@@ -140,12 +139,19 @@ int TnoteObject::index() const {
 
 void TnoteObject::setStaff(TstaffObject* staffObj) {
   if (staffObj != m_staff) {
-    m_staff = staffObj;
-    setParentItem(m_staff->staffItem());
-    if (m_wrapper->beam() && m_wrapper->beam()->last()->item() == this)
-      m_wrapper->beam()->changeStaff(m_staff);
-    if (m_name)
-      m_name->setParentItem(parentItem());
+      m_staff = staffObj;
+      if (m_staff) {
+          setParentItem(m_staff->staffItem());
+          if (m_wrapper->beam() && m_wrapper->beam()->last()->item() == this)
+            m_wrapper->beam()->changeStaff(m_staff);
+          // TODO This is good point to delete beam here, when staff becomes null
+      } else {
+          setParentItem(nullptr);
+          if (m_name)
+            m_name->setParentItem(parentItem());
+      }
+      if (m_name)
+        m_name->setParentItem(parentItem());
   } else
       qDebug() << debug() << "has staff set already";
 }
diff --git a/src/libs/core/score/tnotepair.cpp b/src/libs/core/score/tnotepair.cpp
index 3c0a2c53f35926f2f97ccf821449c7416d5c6b79..5ce1473f249568802495f2c4a776b51c57821b55 100644
--- a/src/libs/core/score/tnotepair.cpp
+++ b/src/libs/core/score/tnotepair.cpp
@@ -31,6 +31,12 @@ TnotePair::TnotePair(int index, Tnote* n, TnoteObject* ob) :
 }
 
 
+TnotePair::~TnotePair()
+{
+  delete m_noteItem;
+}
+
+
 void TnotePair::setNoteObject(TnoteObject* ob) {
   m_noteItem = ob;
 }
diff --git a/src/libs/core/score/tnotepair.h b/src/libs/core/score/tnotepair.h
index d1b4b9ae5914e41a7c6b85b7262f6df09a460e3a..fb95d10a1015a1691a21c6cf4255946298511dd7 100644
--- a/src/libs/core/score/tnotepair.h
+++ b/src/libs/core/score/tnotepair.h
@@ -43,6 +43,7 @@ class TnotePair
 
 public:
   TnotePair(int index = -1, Tnote* n = nullptr, TnoteObject* ob = nullptr);
+  ~TnotePair();
 
   Tnote* note() { return m_note; }
   TnoteObject* item() { return m_noteItem; }
diff --git a/src/libs/core/score/tscoreobject.cpp b/src/libs/core/score/tscoreobject.cpp
index 0b945d6211634aa2d6e8781ad5a5706ca5318ecd..882f9bdff5478b98844feaa64721ac6d18854350 100644
--- a/src/libs/core/score/tscoreobject.cpp
+++ b/src/libs/core/score/tscoreobject.cpp
@@ -125,14 +125,33 @@ void TscoreObject::setClefType(Tclef::EclefType ct) {
 
 
 void TscoreObject::setMeter(int m) {
+CHECKTIME (
   // set notes grouping
   m_meter->setMeter(static_cast<Tmeter::Emeter>(m));
   updateMeterGroups();
-  for (TmeasureObject* m : m_measures) {
-    m->meterChanged();
+
+  if (measuresCount() && firstMeasure()->noteCount() > 0) {
+    qDeleteAll(m_measures);
+    m_measures.clear();
+    qDeleteAll(m_segments);
+    m_segments.clear();
+    while (m_staves.count() > 1) {
+      auto ls = m_staves.takeLast();
+      ls->staffItem()->deleteLater();
+    }
+    m_measures << new TmeasureObject(0, this);
+    lastStaff()->appendMeasure(firstMeasure());
+    firstStaff()->setFirstMeasureId(0);
+    QList<Tnote> oldList = m_notes;
+    m_notes.clear();
+    for (int n = 0; n < oldList.size(); ++n) {
+      addNote(oldList[n]);
+    }
+    adjustScoreWidth();
   }
   qDebug() << "[TscoreObject] Meter changed" << m_meterGroups;
   emit meterChanged();
+)
 }