perror() replaced by logf_msg_e() almost everywhere