Fixed some syntax errors and an ajax error