Fixed bug when removing pivot