Fixed minor syntax errors and obsolete code