Fixed some syntax warnings and errors