Fix displacement for odd resolutions and an off-by-one error.