Fixes to syntax and all logging