misc fixes to syntax and compilation errors