Adding missing () for functions and improved syntax error function