logging matches better, and correct printf codes