Fix off-by-one in 'ad' command