Fix syntax error when using typeof