add syslog support, fix some warnings