Fixed syntax errors and minor issues