Fix syntax error and import needed functions.