Fixed a mistake in MovingBlocks; did not work correctly, if l == N.