fix small bugs in tools