Fixed all the syntax errors and warnigns