fix verify to accept zero padded strings and make sure other cases are covered