fixes
import macros to the tool definition
several fixes and cleanups