Fix off-by-one error in find_space