Some tool functions.