 
             this.moveUp = (block) ->
                 if block.canMoveUp
-                    index = getIdx block
+                    index = _.indexOf $scope.blocks, block
 
                     if index > 0
                         current = $scope.blocks[index]


            this.moveDown = (block) ->
                if block.canMoveDown
                    index = getIdx block

                    if index < $scope.blocks.length - 1
                        current = $scope.blocks[index]


            this.editBlock = (block) ->
                _rollbackStorage[block.$$hashKey] = _.cloneDeep block
                block.editing = yes

            this.submitBlockEdit = (block) ->
                block.saved = yes
                block.editing = no

            this.rollbackBlockEdit = (block) ->

                # If block wasn't previously saved, delete it right away
                if not block.saved
