fix incorrect constructor reference semantics
initialize log level before writing to log
check event type before static_cast
Merge pull request #162 from benkay86/master

fix compilation error and minor runtime errors