More cleanups and syntax corrections