Syntax check message before appending it; address various declaration and printing/logging related issues