Solaris versions of grep, diff, tail, and sed are different from the GNU versions, causing some test cases to fail. Work around these differences in OS-independent ways, and introduce new checks in check-code.py to prevent them from sneaking back in in the future.