fixed compile tool functions