Remove unused code, syntax fixes