Added DEFINE-TOOL macro
Minor fixes