Added validation of parameters to movingBlocks().