Second-level testing revisited and applications to NIST SP800-22