Fixed bugs and refactored label move functionality