bug fixes of the tools, new script for debugging purposes