Added some error checking and returns to the new 'move' code.