Now properly flushes stdout in exhaustive search